ELEMENTS_AT_POS

All functions > ARRAY > ELEMENTS_AT_POS

Returns the elements at multiple specified positions in an array.

Syntax

ELEMENTS_AT_POS(array: ARRAY<T>, positions: ARRAY<BIGINT>) → ARRAY<T>
sql

Type Parameters:

  • T: Any type

Arguments

ParameterTypeRequiredDescription
arrayARRAY<T>YesThe array to access
positionsARRAY<BIGINT>YesArray of 1-based positions to extract

Returns

ARRAY - Array containing elements at the specified positions

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
Last update at: 2025/10/13 10:23:46