The first argument is the separator for the rest of the arguments.
If the separator is NULL, the result is NULL.
CONCAT_WS() does not skip empty strings.
CONCAT_WS() does skip any NULL values after the separator argument.
mysql> mysql> mysql> SELECT CONCAT_WS(',','First name','Second name','Last Name'); +-------------------------------------------------------+ | CONCAT_WS(',','First name','Second name','Last Name') | +-------------------------------------------------------+ | First name,Second name,Last Name | +-------------------------------------------------------+ 1 row in set (0.02 sec) mysql>
23.9.CONCAT_WS | ||||
23.9.1. | CONCAT_WS(separator,str1,str2,...) | |||
23.9.2. | Using CONCAT_WS with NULL value | |||
23.9.3. | Using CONCAT_WS with data in a table |