Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

CONCAT

Example

Combine multiple strings into a single string by adding them together.

SELECT CONCAT(“SQL ““Tutorial ““is ““fun!”AS ConcatenatedString; 

Definition and Usage

The CONCAT() function merges two or more expressions.

Note: Additionally, consider exploring the CONCAT_WS() function.

Syntax

CONCAT(expression1expression2expression3,…)

Parameter Values

Parameter

Description

expression1,
expression2,
expression3,
etc.

Necessary: The expressions to be combined.

Note: If any of the expressions are NULL values, the function returns NULL.

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Combine the data from three columns into a single column named “Address”.

SELECT CONCAT(Address, ” “, PostalCode, ” “, City) AS Address
FROM Customers;