pepperwind / answer_key /kpis /club_ended_subscriptions.sql
rasinmuhammed's picture
Pepperwind Trading Co. preview, version 1.0
27ec678 verified
Raw History Blame Contribute Delete
287 Bytes
-- Club subscriptions ended
-- Paid-for subscriptions by the month they ended.
SELECT strftime(ended_at, '%Y-%m') AS month, count(*) AS value FROM billing.subscription WHERE ended_at >= TIMESTAMP '2023-10-01' AND ended_at < TIMESTAMP '2026-10-01' AND (NOT is_gift) GROUP BY 1 ORDER BY 1