Skip to main content

ARRAY_INDEXOF

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

Syntax

ARRAY_INDEXOF( <array>, <element> )

Examples

SELECT ARRAY_INDEXOF([1, 2, 9], 9);

┌─────────────────────────────┐
│ array_indexof([1, 2, 9], 9)
├─────────────────────────────┤
3
└─────────────────────────────┘
Did this page help you?
Yes
No
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today