Beginner

51. SQL Concatenation

Learn how to combine multiple text values or columns into a single result.

📘 Lesson 51 of 728 ⏱ 7 min 🎯 Beginner

SQL concatenation means combining two or more text values into a single string. Database systems provide different methods and functions for concatenation, such as CONCAT or the concatenation operator depending on the database system.

Business data is often stored across multiple columns. Concatenation allows analysts to create useful combined values such as full names, complete addresses, product descriptions, or display labels.

If an Employees table stores FirstName and LastName separately, concatenation can combine them into a FullName value.

SQL
SELECT
    CONCAT(FirstName, ' ', LastName) AS FullName
FROM Employees;

Concatenation is useful for employee names, customer names, addresses, report labels, email messages, product descriptions, and formatted output.

  • Concatenation combines text values.
  • CONCAT is supported by many database systems.
  • Concatenation can combine multiple columns.
  • A separator can be added between values.
  • Syntax can vary between database systems.
What is concatenation in SQL?

Concatenation means combining two or more text values into a single string.

Which function is commonly used for concatenation?

The CONCAT function is commonly used, although syntax can vary between database systems.

Have you finished this lesson?

Introduction to SQL – All Lessons