sql / beginner
Snippet
Merging Multiple String Columns with CONCAT
The CONCAT scalar function combines multiple string expressions into a single text value. It simplifies formatting text output directly within SQL queries.
snippet.sql
sql
1
2
SELECT CONCAT(first_name, ' ', last_name) AS full_nameFROM employees;
Breakdown
1
SELECT CONCAT(first_name, ' ', last_name) AS full_name
Joins first_name, a space character, and last_name into one string labeled as full_name.
2
FROM employees;
Specifies the employees table as the target data source.