SQLite 3 reference · String Functions

SQLite CONCAT_WS() Function

Join values with a separator between them, skipping NULLs. The ws stands for with separator.

SQLite 3 Since 3.44.0

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

concat_ws(SEP, X, ...)

Parameters

ParameterDescription
SEP The separator.
X, ... The values to join.

Return value

Text, or NULL if SEP is NULL.

Examples

Join with a separatorTry it yourself
SELECT concat_ws(', ', name, city, country) AS address
FROM customers
WHERE customer_id IN (1, 7);

Output

address
Ada Lovelace, London, UK
Barbara Liskov, USA
Build a date stringTry it yourself
SELECT concat_ws('-', '2026', '03', '09') AS iso_date;

Output

iso_date
2026-03-09

Version history

VersionChange
SQLite 3.44.0Added

In other languages

Was this page helpful?