Beginner

229. CONCAT Function

Learn how to combine multiple values using the CONCAT function.

📘 Lesson 229 of 728 ⏱ 9 min 🎯 Beginner

The CONCAT function combines multiple values into a single string. It is commonly available across modern relational database systems, although behavior around NULL values can vary.

CONCAT provides a clear way to build combined text values without relying entirely on database-specific concatenation operators.

Create a full customer name from first and last names.

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

CONCAT is useful for names, addresses, labels, identifiers, and report-ready text.

  • CONCAT combines multiple values.
  • It can include literal separators.
  • It is useful for creating display fields.
  • NULL behavior depends on the database.
  • It is often easier to read than complex concatenation expressions.
What does CONCAT do?

CONCAT combines multiple values into a single text string.

Why use CONCAT instead of manual concatenation?

CONCAT provides a clear and convenient way to combine multiple values and can simplify handling of text expressions.

Have you finished this lesson?

Introduction to SQL – All Lessons