Add several strings together:
SELECT CONCAT("SQL ", "Tutorial ", "is ", "fun!") AS ConcatenatedString;
Try it Yourself »
The CONCAT() function adds two or more expressions together.
Note: Also look at the CONCAT_WS() function.
CONCAT(
expression1,
expression2,
expression3,...)
Parameter | Description |
---|---|
expression1, expression2, expression3, etc. |
Required. The expressions to add together. Note: If any of the expressions is a NULL value, it returns NULL |
Works in: | From MySQL 4.0 |
---|
Add three columns into one "Address" column:
SELECT CONCAT(Address, " ", PostalCode, " ", City) AS Address
FROM Customers;
Try it Yourself »
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!