scalar

JSON_QUERY

Returns JSON rather than a scalar SQL value; wrapper options control multiple matches. Example target: PostgreSQL 17. No tables or extensions required.

Formal Syntax & Structure

sql syntaxsql
JSON_QUERY(context_item,path)

Working Example

Example Snippetsql
SELECT JSON_QUERY('{"a":[1,2]}'::jsonb, '$.a')::jsonb = '[1,2]'::jsonb;
SQL Reference