split_part
Split text at a separator and retrieve one part by its position.
Try an expression
In Formula, enter the expression and set Output type to VARCHAR.
Expression
split_part('a;b;c', ';', 2)Result
'b'To use your own data, replace the example values with column names. Keep format strings and other options as written.
Arguments and types
split_part(string, delimiter, position)- string
- Any value
- delimiter
- Any value
- position
- Any value
Supported signatures (1)
split_part(string: ANY, delimiter: ANY, position: ANY)The result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
Positions start at 1. An out-of-range position returns an empty string.
If the first argument is missing, the result is NULL.
A position outside the text
split_part('a;b;c', ';', 9)''
Function metadata from DuckDB, used under the MIT license.