SQL examples

Inspect the actual SQL, returned values, and PostgreSQL column types from the comparison fixtures.

JSON window aggregation

Each customer has a running JSON array ordered by invoice ID.

SELECT cust, jsonb_agg(amount) OVER (PARTITION BY cust ORDER BY id) FROM inv ORDER BY id

Recorded results

SELECT 3
#custtextjsonb_aggjsonb
1acme[100.50]
2acme[100.50, -20.25]
3beta[0.00]
Current regression corpus · array and JSON group · case 23

These examples use saved replay results. Run your own query or see the full comparison.