CONCAT_WS

functionsupportedCore SQL functions

docs.snowflake.com ↗

String & binary functions

Concatenates two or more strings, or concatenates two or more binary values, and uses the first argument as a delimiter between the following strings. Note Unlike some implementations of the CONCAT_WS function, the Snowflake CONCAT_WS function doesn’t skip NULL values.

Syntax

CONCAT_WS( <separator> , <expression> [ , <expression> ... ] )

Parameters

NameRequiredDescription
separatorrequiredThe separator must meet the same requirements as expression.
expressionrequiredThe input expressions must be all strings, or all binary values.

Returns

The function returns a VARCHAR or BINARY value that contains the 2nd through Nth arguments, separated by the first argument. If any argument is NULL, the function returns NULL. The data type of the returned value is the same as the data type of the input values.

Usage notes

Collation details

- The collation specifications of all input arguments must be compatible. - The collation of the result of the function is the highest-precedence collation of the inputs.

See also

Referenced by