Categories: Semi-Structured Data
ARRAY_REMOVE_AT
Returns the input array with the element at the specified position removed.
Syntax
ARRAY_REMOVE_AT(arr LIST, position int32) → list
- arr: Array from which to remove the element at the specified position.
- position: The zero-based position of the element to be removed. The function removes the element at the specified position. A negative position is interpreted as an index from the back of the array. For example, the value
-1
removes the last element in the array.
Examples
ARRAY_REMOVE_AT exampleSELECT ARRAY_REMOVE_AT(ARRAY[1, 2, 3], 1)
-- [1, 3]
SELECT ARRAY_REMOVE_AT(ARRAY[1, 2, 3], -1)
-- [1, 2]
SELECT ARRAY_REMOVE_AT(ARRAY[1, 2, 3], 10)
-- [1, 2, 3]