row_number
A window function computes over related rows without collapsing them. PARTITION BY makes groups, ORDER BY orders inside each.
task
Number each customer's orders by date (oldest is 1, ties by order_id): columns order_id and the number.
Run a query to see rows here.
Run EXPLAIN on the statement under the cursor: Plan tab, button Explain.
No tables yet.
A window function computes over related rows without collapsing them. PARTITION BY makes groups, ORDER BY orders inside each.
Number each customer's orders by date (oldest is 1, ties by order_id): columns order_id and the number.