Combine two strings:
| SELECT CONCAT(‘W3Schools’, ‘.com’); |
The CONCAT() function joins two or more strings together.
Note: See also string concatenation with the + operator and CONCAT_WS().
| CONCAT(string1, string2, …., string_n) |
|
Parameter |
Description |
|
String1, string2 string_n |
Mandatory. Specifies the strings to be concatenated. |
|
Works in: |
SQL Server (from 2012 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |
Combine three strings:
| SELECT CONCAT(‘SQL’, ‘ is’, ‘ fun!’); |
| SELECT CONCAT(‘SQL’, ‘ ‘, ‘is’, ‘ ‘, ‘fun!’); |