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

MySQL CONCAT() Function

Example

Add several strings together:

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

Definition and Usage

The CONCAT() function adds two or more expressions together.

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