concat_ws
function
Applies to: Databricks SQL Databricks Runtime
Returns the concatenation strings separated by sep
.
Syntax
concat_ws(sep [, expr1 [, ...] ])
Arguments
sep
: An STRING expression.exprN
: EachexprN
can be either a STRING or an ARRAY of STRING.
Returns
The result type is STRING.
If sep
is NULL the result is NULL.
exprN
that are NULL are ignored.
If only the separator is provided, or all exprN
are NULL, an empty string.
Examples
> SELECT concat_ws(' ', 'Spark', 'SQL');
Spark SQL
> SELECT concat_ws('s');
''
> SELECT concat_ws(',', 'Spark', array('S', 'Q', NULL, 'L'), NULL);
Spark,S,Q,L
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for