MySQL CONCAT_WS() Function

Example

Add several expressions together, and add a “-” separator between them:

SELECT CONCAT_WS("-", "SQL", "Tutorial", "is", "fun!") AS ConcatenatedString;

Definition and Usage

The CONCAT_WS() function adds two or more expressions together with a separator.

Note: Also look at the CONCAT() function. Continue reading MySQL CONCAT_WS() Function