Eric Bower
·
2026-04-17
1select
2 count(distinct user_id) as active_posts,
3 date_trunc('month', updated_at) as month
4from posts
5group by month
6order by month DESC;
7
8select
9 count(distinct user_id) as active_sites,
10 date_trunc('month', updated_at) as month
11from projects
12group by month
13order by month DESC;
14
15select
16 count(id) as new_users,
17 date_trunc('month', created_at) as month
18from app_users
19group by month
20order by month DESC;
21
22select
23 count(id) as subs,
24 date_trunc('month', created_at) as month
25from feature_flags
26where name = 'plus' and expires_at > now()
27group by month
28order by month DESC;
29
30select
31 count(*) as total_subs
32from feature_flags
33where name = 'plus' and expires_at > now();