sqlcmd.net validated sql reference

#json

Commands grouped around the same concept, pattern, or recurring problem.

8 commands with this tag Browse related patterns quickly
advanced json MySQL MariaDB SQL Server PostgreSQL SQLite

Aggregate Rows Into A JSON Array

Collect values from multiple rows into a single JSON array, ordered and grouped by other columns.

advanced json MySQL MariaDB SQL Server PostgreSQL SQLite

Build A JSON Object From Column Values

Construct a JSON object literal from individual column values within a query, returning structured data without a separate serialization step.

intermediate json MySQL MariaDB SQL Server PostgreSQL SQLite

Count Elements In A JSON Array

Return the number of items stored in a JSON array value.

intermediate array MySQL SQL Server PostgreSQL SQLite

Expand an Array or JSON Array Into One Row Per Element

Turn a list of values into individual rows — using `UNNEST` for native arrays in PostgreSQL, `JSON_TABLE` in MySQL, `OPENJSON` in SQL Server, or `json_each` in SQLite.

advanced json MySQL MariaDB SQL Server PostgreSQL SQLite

Filter JSON Arrays Containing A Value

Return rows where a JSON array contains a specific scalar value.

intermediate json MySQL MariaDB SQL Server PostgreSQL SQLite

Filter Rows by a Value Inside a JSON Column

Use each engine's JSON path syntax in a `WHERE` clause to keep only rows whose JSON column contains a matching value.

advanced json MySQL MariaDB SQL Server PostgreSQL SQLite

Read a Value From a JSON Column

Extract a scalar value from a JSON column using the JSON function or operator each engine supports.

intermediate json MySQL MariaDB SQL Server PostgreSQL SQLite

Update a Value Inside a JSON Column

Modify a single key in a stored JSON document without replacing the whole object, using `JSON_SET` (MySQL/MariaDB/SQLite), `JSON_MODIFY` (SQL Server), or `jsonb_set` (PostgreSQL).