Syntax
CONCAT_WS(separator, str1, .., strN)
Purpose
CONCAT_WS() concatenates multiple strings into one string, with adjacent strings separated with the separator specified for separator. If the parameters include a NULL value, 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