Syntax
CONCAT_WS(separator, str1, .., strN)
Purpose
You can call this function to concatenate multiple strings into one string, with adjacent strings separated with the separator specified by separator. If any argument is NULL, the NULL value is ignored.
This function does not ignore empty strings.
Examples
obclient> SELECT
CONCAT_WS('_', 'First', 'Second'),
CONCAT_WS('_', 'First', NULL, 'Second')
\G
*************************** 1. row ***************************
CONCAT_WS('_', 'First', 'Second'): First_Second
CONCAT_WS('_', 'First', NULL, 'Second'): First_Second
1 row in set (0.00 sec)