Skip to content

Returns the index(1-based) of an element if the array contains the element.

func.array_indexof( <array>, <element> )
func.array_indexof([1, 2, 9], 9)
┌───────────────────────────────────┐
│ func.array_indexof([1, 2, 9], 9) │
├───────────────────────────────────┤
3
└───────────────────────────────────┘
ARRAY_INDEXOF( <array>, <element> )
SELECT ARRAY_INDEXOF([1, 2, 9], 9);
┌─────────────────────────────┐
│ array_indexof([1, 2, 9], 9) │
├─────────────────────────────┤
3
└─────────────────────────────┘