PostgreSQL · Function
json_agg
json_agg combines values from input rows into one JSON array. It includes nulls and supports ordering inside the aggregate call.
Last updated
Syntax
json_agg ( anyelement ORDER BY input_sort_columns ) → jsonIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
jsonb_aggjson_agg_strictjson_arrayaggjson_object_aggto_jsonto_jsonb