Download answer_key/kpis/club_active_subscriptions.sql from misatadata/pepperwind: direct link, hf CLI and curl.
- Browser
- Download file 489 Bytes
-
https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/club_active_subscriptions.sql
- Command line
-
hf download hf://datasets/misatadata/pepperwind/answer_key/kpis/club_active_subscriptions.sql
-
curl -L -o club_active_subscriptions.sql https://huggingface.co/datasets/misatadata/pepperwind/resolve/main/answer_key/kpis/club_active_subscriptions.sql
489 Bytes
| -- Club subscriptions live at each month's end | |
| -- Paid-for (not gift) subscriptions begun before the month's end and not ended by then. | |
| WITH m AS (SELECT strftime(range, '%Y-%m') AS month, range AS t0, range + INTERVAL 1 MONTH AS t FROM range(TIMESTAMP '2023-10-01', TIMESTAMP '2026-10-01', INTERVAL 1 MONTH)) SELECT m.month, count(*) AS value FROM m JOIN billing.subscription x ON x.start_date < m.t AND (x.ended_at IS NULL OR x.ended_at >= m.t) AND (NOT x.is_gift) GROUP BY 1 ORDER BY 1 | |