SQL Tip: JSONB_AGG in PostgreSQL for simple one-to-many joins
medium.com
medium.com
I wish there was an equivalent function in PostgreSQL. I've even asked a question about that on stackoverflow:
https://stackoverflow.com/questions/8637050/cursor-inside-sq...