1pico=# select
2 count(distinct user_id),
3 date_trunc('month', updated_at) as month
4from projects
5group by month
6order by month DESC;
7 count | month
8-------+---------------------
9 20 | 2024-10-01 00:00:00
10 21 | 2024-09-01 00:00:00
11 22 | 2024-08-01 00:00:00
12 24 | 2024-07-01 00:00:00
13 13 | 2024-06-01 00:00:00
14 19 | 2024-05-01 00:00:00
15 29 | 2024-04-01 00:00:00
16 40 | 2024-03-01 00:00:00
17 34 | 2024-02-01 00:00:00
18 6 | 2024-01-01 00:00:00
19 2 | 2023-11-01 00:00:00
20 1 | 2023-10-01 00:00:00
21 5 | 2023-09-01 00:00:00
22 1 | 2023-08-01 00:00:00
23
24select
25 count(distinct user_id),
26 date_trunc('month', updated_at) as month
27from posts
28group by month
29order by month DESC;
30
31 count | month
32-------+------------------------
33 26 | 2024-10-01 00:00:00+00
34 44 | 2024-09-01 00:00:00+00
35 65 | 2024-08-01 00:00:00+00
36 56 | 2024-07-01 00:00:00+00
37 42 | 2024-06-01 00:00:00+00
38 29 | 2024-05-01 00:00:00+00
39 36 | 2024-04-01 00:00:00+00
40 49 | 2024-03-01 00:00:00+00
41 29 | 2024-02-01 00:00:00+00
42 21 | 2024-01-01 00:00:00+00
43 5 | 2023-12-01 00:00:00+00
44 22 | 2023-11-01 00:00:00+00
45 31 | 2023-10-01 00:00:00+00
46 38 | 2023-09-01 00:00:00+00
47 25 | 2023-08-01 00:00:00+00
48 43 | 2023-07-01 00:00:00+00
49 47 | 2023-06-01 00:00:00+00
50 29 | 2023-05-01 00:00:00+00
51 33 | 2023-04-01 00:00:00+00
52 39 | 2023-03-01 00:00:00+00
53 41 | 2023-02-01 00:00:00+00
54 49 | 2023-01-01 00:00:00+00
55 52 | 2022-12-01 00:00:00+00
56 53 | 2022-11-01 00:00:00+00
57 58 | 2022-10-01 00:00:00+00
58 62 | 2022-09-01 00:00:00+00
59 591 | 2022-08-01 00:00:00+00
60 1 | 2022-05-01 00:00:00+00
61 1 | 2022-04-01 00:00:00+00
62 1 | 2022-03-01 00:00:00+00