ELEMENT_AT_POS

All functions > ARRAY > ELEMENT_AT_POS

Returns the element at the specified position in an array.

Syntax

ELEMENT_AT_POS(array: ARRAY<T>, position: BIGINT) → T
sql

Type Parameters:

  • T: Any type

Arguments

ParameterTypeRequiredDescription
arrayARRAY<T>YesThe array to access
positionBIGINTYes1-based position (negative values count from end)

Returns

Element type - The element at the specified position

Notes

  • Uses 1-based indexing (first element is at position 1)
  • Negative positions count from the end (-1 is last element)
  • Returns NULL if position is out of bounds
  • Returns NULL if array is NULL
Last update at: 2025/10/13 10:23:46