ELEMENTS_AT_POS
All functions > ARRAY > ELEMENTS_AT_POS
Returns the elements at multiple specified positions in an array.
Signatures
Returns: Array containing elements at the specified positions
ELEMENTS_AT_POS(array: ARRAY<T>, positions: ARRAY<BIGINT>) → ARRAY<T> sql
| Parameter | Type | Required | Description |
|---|---|---|---|
array | ARRAY<T> | Yes | The array to access |
positions | ARRAY<BIGINT> | Yes | Array of 1-based positions to extract |
Notes
- Uses 1-based indexing for positions
- Negative positions count from the end
- Out of bounds positions return NULL for that element
- Preserves the order of positions array
On this page