In MySQL, the CONCAT() function joins (concatenates) multiple strings into one.
CONCAT(str1, str2, ..., strN)
Return value
Examples
Simple concatenation
SELECT CONCAT('Hello', ' ', 'World');
Result: Hello World
Important behavior (NULL)
SELECT CONCAT('Hello', NULL, 'World');
Result:NULL
If you want to ignore NULL values, use:
CONCAT_WS(separator, str1, str2, ...)
Example:
SELECT CONCAT_WS(' ', 'Hello', NULL, 'World');
Result:
Hello World