Categories: Semi-Structured Data
SUBLIST
Returns an array constructed from the specified subset of elements of the input array.
Syntax
SUBLIST(arr LIST, offset INT, length INT) → LIST
- arr: The input array.
- offset: The offset from which the sublist should start.
- length: The maximum length of the sublist.
Examples
SUBLIST exampleSELECT SUBLIST(ARRAY[1,2,3,4,5], 0, 3)
-- [1,2,3]
SELECT SUBLIST(ARRAY[1,2,3,4,5], 3, 3)
-- [3,4,5]