ARRAY_REMOVE_AT
functionsupportedCore SQL functionsGiven a source ARRAY, returns an ARRAY with the element at the specified position removed. For example, ARRAY_REMOVE_AT([2, 5, 7], 0) returns an ARRAY with the element at position 0 removed ([5, 7]).
Syntax
ARRAY_REMOVE_AT( <array> , <position> )
Parameters
| Name | Required | Description |
|---|---|---|
array | required | The source array. |
position | required | The (zero-based) position of the element to be removed. The function removes the element at this position. A negative position is interpreted as an index from the back of the array (e.g. -1 removes the last element in the array). |
Returns
An ARRAY with the element at the specified position removed. If position is NULL, the function returns NULL.
Usage notes
- If the absolute value of position exceeds the length of array, the function returns array without any elements removed.