I need to return only the JSON from multiple rows where keys are matched. What am I missing?
SELECT jsonb_object_agg(key, value) FROM jsonb_each((SELECT data from hit_count_13306823936951630992)) WHERE key IN ('8517', '1099');
ERROR: more than one row returned by a subquery used as an expression