Help Center/ DataArts Fabric/ Developer Guide/ SQL Syntax Reference/ Functions and Operators/ Set Returning Functions/ Subscript Generating Functions
Updated on 2025-12-19 GMT+08:00
Subscript Generating Functions
generate_subscripts(array anyarray, dim int)
Description: Generates a series comprising the given array's subscripts.
Return type: setof int
Example:
1 2 3 4 5 6 7 8 | SELECT generate_subscripts('{NULL,1,NULL,2}'::int[], 1) AS s; s --- 1 2 3 4 (4 rows) |
generate_subscripts(array anyarray, dim int, reverse boolean)
Description: Generates a series comprising the given array's subscripts. When reverse is true, the series is returned in reverse order.
Return type: setof int
Example:
1 2 3 4 5 6 7 8 | SELECT generate_subscripts('{NULL,1,NULL,2}'::int[], 1,TRUE) AS s; s --- 4 3 2 1 (4 rows) |
Parent topic: Set Returning Functions
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot