Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Monthly Active Users

Using a CTE, return the number of distinct active users per month as month ('YYYY-MM') and active_users, ordered by month.

Table schema

Activity(user_id INT, activity_date DATE)

Sample data

user_id | activity_date
1 | 2026-01-05
1 | 2026-01-20
2 | 2026-01-10
1 | 2026-02-03
3 | 2026-02-04
3 | 2026-02-09

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.