SQLite STRING_AGG() Function
Example
Join all the shipper names, with a comma and a space:
SELECT STRING_AGG(ShipperName, ', ')
FROM Shippers;
Try it Yourself »
Definition and Usage
The STRING_AGG() function joins all the values in a group into one text, with a separator between them. It works like GROUP_CONCAT(), but the separator is required.
Tip: Also look at GROUP_CONCAT().
Syntax
STRING_AGG(expression, separator)
Parameter Values
| Parameter | Description |
|---|---|
| expression | Required. A column or a calculation |
| separator | Required. The text to put between the values |
Technical Details
| Return type: | Text |
|---|---|
| Works in: | SQLite 3.44.0 and later |