Beginner

228. String Concatenation

Learn how to combine multiple text values into one string.

📘 Lesson 228 of 728 ⏱ 9 min 🎯 Beginner

String concatenation combines two or more text values into a single text result. SQL databases use different operators or functions for concatenation.

Combining fields is common when creating display names, addresses, labels, and formatted business information.

Combine first name and last name into a full name.

SQL
SELECT
    FirstName || ' ' || LastName AS FullName
FROM Customers;

Concatenation is useful in reports, customer communication, address formatting, identifiers, and dashboard datasets.

  • Concatenation combines text values.
  • Different databases use different syntax.
  • Separators can be included.
  • NULL values require careful handling.
  • It is useful for display-ready fields.
What is string concatenation?

String concatenation combines multiple text values into one string.

Does every database use the same concatenation operator?

No. Databases may use operators such as || or +, or functions such as CONCAT.

Have you finished this lesson?

Introduction to SQL – All Lessons