SQLite CONCAT_WS() Function
Example
Add three texts together, with a dash between them:
SELECT CONCAT_WS('-', 'SQL', 'is', 'fun');
Try it Yourself »
Definition and Usage
The CONCAT_WS() function adds two or more texts together, with a separator between them.
NULL arguments are skipped, and get no separator.
Tip: Also look at CONCAT().
Syntax
CONCAT_WS(separator, text1, text2, ...)
Parameter Values
| Parameter | Description |
|---|---|
| separator | Required. The text to put between the other texts |
| text1, text2, ... | Required. The texts to add together |
Technical Details
| Return type: | Text |
|---|---|
| Works in: | SQLite 3.44.0 and later |
More Examples
Example
Add the city and country together, with a comma:
SELECT CONCAT_WS(', ', City, Country)
FROM Customers;
Try it Yourself »