MySQL CONCAT() Function is used to concatenate several strings together.

Syntax:

SELECT CONCAT(1st_string, 2nd_string, 3rd_string, …) AS ConcatenatedString;

For example:

SELECT CONCAT('This', 'is', 'a', 'demo', 'query') AS ConcatenatedString;

The output would be: Thisisademoquery

So don’t forget to insert space in between.

Note:

  • If the argument is a numeric value, it will be converted to a binary string.
  • If all arguments are nonbinary strings, this function will return a nonbinary string.
  • If any of the arguments is a binary string, this function will return a binary string.
  • If any of the arguments is a NULL, this function will return a NULL value.

Need a good GUI Tool for MySQL? TablePlus is a modern, native tool with an elegant UI that allows you to simultaneously manage multiple databases such as MySQL, PostgreSQL, SQLite, Microsoft SQL Server and more.


Download TablePlus for Mac.

Not on Mac? Download TablePlus for Windows.

On Linux? Download TablePlus for Linux

Need a quick edit on the go? Download TablePlus for iOS.

TablePlus GUI Tool MySQL