SQLite JSON_GROUP_OBJECT() Function
Example
Return the phone numbers of the shippers as a JSON object:
SELECT JSON_GROUP_OBJECT(ShipperName, Phone)
FROM Shippers;
Try it Yourself »
Definition and Usage
The JSON_GROUP_OBJECT() function is an aggregate function. It returns a JSON object made from a name and a value from each row.
Note: Read more about JSON in the SQLite JSON chapter.
Tip: Also look at JSON_GROUP_ARRAY().
Syntax
JSON_GROUP_OBJECT(name, value)
Parameter Values
| Parameter | Description |
|---|---|
| name | Required. The column with the names |
| value | Required. The column with the values |
Technical Details
| Return type: | Text |
|---|