Select first 10 rows for every 5 of a unique column – Shopify
In a Postgres DB, given the following simplified dataset of orders: ID STORE_ID UPDATED_AT 1 "store-1" 2021-01-01 2 "store-2" 2021-01-02 3 "store-3" 2021-01-03 4 "store-1" 2021-01-04 5 "store-2" 2021-01-05 6 "store-3" 2021-01-06 ... 1000 "store-1" 2021-02-05 How can I write…