Monthly Revenue with a Column per Market

medium
Unit 19 · Union0/2 to milestone

Return one row per order month (YYYY-MM) with columns month, uk, us and other: revenue from customers in the UK, the US, and everywhere else. Use 0 when there's none. Sort by month.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#pivot#conditional-aggregation1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Monthly Revenue with a Column per Market · TechGradify