INDEX_MULTI
All functions > ARRAY OF ROWS > INDEX_MULTI
Returns an index multi computed from the given array and key.
Signatures
Returns: Map from key values to arrays of positions (1-based)
INDEX_MULTI(base: ARRAY<ROW<T>>, key: FIELD) → INDEX sql
| Parameter | Type | Required | Description |
|---|---|---|---|
base | ARRAY<ROW<T>> | Yes | Array of rows to index |
key | FIELD | Yes | Field name to use as lookup key |
Notes
- Creates a multi-valued index mapping key values to arrays of positions
- Each key maps to an array of all positions with that key value
- Returns 1-based array indices sorted by position
- NULL keys are excluded from the index
- Useful for one-to-many lookups with ELEMENTS_AT_KEY
- Preserves all occurrences of duplicate keys
- Use INDEX_UNIQUE for keys with single values
On this page