CONCAT_WS() function allows you to define a separator as one of the arguments in the function : CONCAT_WS « String « SQL / MySQL






CONCAT_WS() function allows you to define a separator as one of the arguments in the function

    
mysql>
CONCAT_WS(<separator>, <string1>, <string2> [{, <string>}...])
mysql>
mysql> SELECT CONCAT_WS(' ', 'cats', 'and', 'dogs');
+---------------------------------------+
| CONCAT_WS(' ', 'cats', 'and', 'dogs') |
+---------------------------------------+
| cats and dogs                         |
+---------------------------------------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
  








Related examples in the same category

1.Use the CONCAT_WS() function to concatenate the employee names.
2.Retrieve 2 concatenated calculated fields