ELEMENT_AT
Retrieves the element of an array at a given index.
Syntax
Arguments
ARRAY(E)
ARRAY(E)
Type: array
A array of values of any type.
INDEX
INDEX
Type: integer
An integer indicating the index of the element to retrieve.
If INDEX > 0
, this function provides the same functionality as the SQL-standard subscript operator ([]
).
If INDEX < 0
, this function accesses elements from the last to the first.
Note that if the ARRAY
contains any null
values, they are ignored in the indexing of the array.
Returns
Type: same as input
The element of ARRAY
at the given INDEX
.
Note that if the INDEX
is 0, then the function returns null
.
Examples
Transformation job example
SQL
Query result
Last updated