pepperwind / answer_key /kpis /b2b_orders.sql
rasinmuhammed's picture
Pepperwind Trading Co. preview, version 1.0
27ec678 verified
Raw History Blame Contribute Delete
338 Bytes
-- Wholesale orders placed, by market
-- Orders on a wholesale account by the month placed.
SELECT strftime(placed_at, '%Y-%m') AS month, market_code AS grp, count(*) AS value FROM commerce.order WHERE placed_at >= TIMESTAMP '2023-10-01' AND placed_at < TIMESTAMP '2026-10-01' AND (b2b_account_id IS NOT NULL) GROUP BY 1, 2 ORDER BY 1, 2