Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
concat_ws
functionApplies to: Databricks SQL Databricks Runtime
Returns the concatenation strings separated by sep
.
concat_ws(sep [, expr1 [, ...] ])
sep
: An STRING expression.exprN
: Each exprN
can be either a STRING or an ARRAY of STRING.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.
> 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
Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayDocumentation
concat function - Azure Databricks - Databricks SQL
Learn the syntax of the concat function of the SQL language in Databricks SQL and Databricks Runtime.
array_join function - Azure Databricks - Databricks SQL
Learn the syntax of the array_join function of the SQL language in Databricks SQL and Databricks Runtime.
array_distinct function - Azure Databricks - Databricks SQL
Learn the syntax of the array_distinct function of the SQL language in Databricks SQL and Databricks Runtime.