Skip to main content
Version: current [25.0.x]

ARRAY_REMOVE_AT

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 example
SELECT ARRAY_REMOVE_AT(ARRAY[1, 2, 3], 1)
-- [1, 3]
ARRAY_REMOVE_AT example
SELECT ARRAY_REMOVE_AT(ARRAY[1, 2, 3], -1)
-- [1, 2]
ARRAY_REMOVE_AT example
SELECT ARRAY_REMOVE_AT(ARRAY[1, 2, 3], 10)
-- [1, 2, 3]