sqlcmd.net validated sql reference
beginner string-processing MySQL MariaDB SQL Server PostgreSQL SQLite

Join Strings With CONCAT

Combine multiple text values into one string in the query result.

Docker-validated Not currently validation-green

Combine first and last name columns

The result is one display-ready string built from two separate columns.

Rows loaded before the example query runs.
Setup
CREATE TABLE people (first_name VARCHAR(50), last_name VARCHAR(50));

INSERT INTO
  people (first_name, last_name)
VALUES
  ('Ada', 'Lovelace');
Shared across supported engines.
SQL
SELECT
  CONCAT (first_name, ' ', last_name) AS full_name
FROM
  people;
Returned rows for the shared example.
full_name
Ada Lovelace

All supported engines accept the same `CONCAT` call in this example.

Where this command helps.

  • building display labels from multiple columns
  • assembling simple formatted strings for reports or exports

What the command is doing.

CONCAT is useful when building display labels, full names, or simple formatted text directly in SQL. It is usually easier to read than chaining engine-specific string concatenation operators.