support_calls(call_id, user_id, called_at)
Return the users who contacted support at least three times during September
2026, as user_id and call_count, ordered by user_id.
A user whose third call falls in October does not qualify, so the count has to happen after the date filter rather than before it.
Tables
support_calls
call_id user_id called_at
------- ------- -------------------
1 10 2026-09-02 09:00:00
2 10 2026-09-05 09:00:00
3 10 2026-09-09 09:00:00
4 11 2026-09-02 09:00:00
5 11 2026-09-03 09:00:00
6 12 2026-09-01 09:00:00
7 12 2026-09-02 09:00:00
8 12 2026-10-01 09:00:00
... 3 more row(s)
Expected result
user_id call_count
------- ----------
10 3
Sign in to write and run your own code.
SELECT query