ARRAY_POSITION(expr, val)
Description
This function returns the first position of the specified value within the array expression.
The array position is zero-based; that is, the first position is 0.
See also [fn-array-binary-search].
Arguments
- expr
-
[Required] The array you want to search.
- val
-
[Required] The value whose position you want to know.
Return Values
An integer representing the first position of the input val, where the first position is 0.
If the value val occurs more than once within the array expr, only the first position is returned.
It returns -1 if the input val does not exist in the array.
If one of the arguments is MISSING, it returns MISSING.
If either of the arguments are non-array values, it returns NULL.