Lists & arrays
Scalar
array_position()
Returns the index of the element if the list contains the element. If the element is not found, it returns NULL.
Alias of list_position()
Arguments & returns
array_position(list, element)
Scalar
| Overload link | list | element |
Returns |
|---|---|---|---|
| #01 | T[] | T |
INTEGER |
Example
Haybarn WASM 1.5.5-rc3 · In your browser
Engine example · Run to view results.
In other engines
Snowflake
SELECT ARRAY_POSITION(2, ARRAY_CONSTRUCT(1, 2, 3))
SELECT ARRAY_POSITION([1, 2, 3], 2) - 1