The CONCAT
function in SQL is used to join (concatenate) two or more strings into a single string.
SELECT CONCAT('Hello', ' ', 'World');
Result:
Hello World
SELECT CONCAT(first_name, ' ', last_name) AS full_name
FROM users;
first_name
and last_name
with a space in between.full_name
.CONCAT
can take two or more arguments.NULL
, the result is NULL
(in some databases like MySQL).CONCAT()
.