CONCAT_WS(...)
All functions > STRING > CONCAT_WS(...)
Joins an array of VARCHAR values with a delimiter between elements (array form of CONCAT_WS).
Signatures
Returns: Joined string
CONCAT_WS_FN(separator: VARCHAR, strings: ARRAY(VARCHAR)) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
separator | VARCHAR | Yes | Delimiter inserted between non-omitted elements |
strings | ARRAY(VARCHAR) | Yes | Strings to join in order |
Notes
- Same semantics as variadic
CONCAT_WS(sep, ...)once arguments are bundled into an array NULLarray elements are skipped (no delimiter-only gap); useCOALESCE(x, '')if you need an empty segment and separators around it
Related operators
Examples
CONCAT_WS_FN(...)
FeatureQL
SELECT
f1 := CONCAT_WS_FN('-', ARRAY['A', 'B', 'C']), -- Separator and array of strings
f2 := CONCAT_WS_FN(', ', ARRAY['Apple', 'Banana']) -- Comma–space delimiter
;Result
| f1 VARCHAR | f2 VARCHAR |
|---|---|
| A-B-C | Apple, Banana |
Edge cases
FeatureQL
SELECT
f1 := CONCAT_WS_FN(' ', ARRAY['Hello', 'World']), -- Single-space separator
f2 := CONCAT_WS_FN('-', ARRAY['A', NULL(VARCHAR), 'B']) -- NULL element omitted
;Result
| f1 VARCHAR | f2 VARCHAR |
|---|---|
| Hello World | A-B |