Best Day in Each Month

medium
Unit 17 · Window Functions X0/2 to milestone

For each month with orders, return month (YYYY-MM), best_day (the date with the highest revenue that month; earliest date on ties) and revenue on that day. Sort by month.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#window-functions#aggregation1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Best Day in Each Month · TechGradify