ARRAY_JOIN
All functions > ARRAY > ARRAY_JOIN
Joins the elements of an array into a single string using a specified delimiter.
Syntax
ARRAY_JOIN(array, delimiter[, null_replacement])
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
array | ARRAYVARCHAR | Yes | Array of strings to join together |
delimiter | VARCHAR | Yes | String to insert between array elements |
null_replacement | VARCHAR | No | Optional replacement string for NULL values |
Returns
A single string with array elements joined by the delimiter
Notes
- Joins array elements into a single string using the specified delimiter
- NULL values are omitted unless a replacement string is provided
- Empty arrays return an empty string
- Single element arrays return just that element (no delimiter)
- Useful for creating CSV-like output or human-readable lists