CONCAT_WS
Concatenate with separator. This function joins strings with a specified separator. It skips NULL values during concatenation.
Syntax
CONCAT_WS(separator,str1,str2,...)Description
Examples
SELECT CONCAT_WS(',','First name','Second name','Last Name');
+-------------------------------------------------------+
| CONCAT_WS(',','First name','Second name','Last Name') |
+-------------------------------------------------------+
| First name,Second name,Last Name |
+-------------------------------------------------------+
SELECT CONCAT_WS('-','Floor',NULL,'Room');
+------------------------------------+
| CONCAT_WS('-','Floor',NULL,'Room') |
+------------------------------------+
| Floor-Room |
+------------------------------------+See Also
Last updated
Was this helpful?

