struct_position
Find the position of a value in an unnamed struct, starting at 1.
Also available as struct_indexof.
Try an expression
In Formula, enter the expression and set Output type to INTEGER.
Expression
struct_position(row(1, 2, 3), 2)Result
2To use your own data, replace the example values with column names. Keep format strings and other options as written.
Arguments and types
struct_position(struct, entry)- struct
- Struct
- entry
- Any value
Supported signatures (1)
struct_position(struct: STRUCT, 'entry': ANY) → INTEGERThe result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
If the first argument is missing, the result is NULL.
Function metadata from DuckDB, used under the MIT license.