SPLIT
All functions > STRING > SPLIT
Splits a string into an array of substrings based on a delimiter.
Syntax
SPLIT(expr, delimiter[, limit])
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
string | VARCHAR | Yes | String to split |
delimiter | VARCHAR | Yes | Delimiter to split on |
limit | BIGINT | No | Maximum number of splits (optional) |
Returns
Array of substrings
Notes
- If delimiter is not found, returns array with original string
- Empty strings between delimiters are included
- If limit is specified, splits into at most limit parts
- With limit, remainder stays together in last element