A new streak starts when a user logs in after missing at least one day. For each distinct (user, date) login, return user_id, login_date and streak_no (1, 2, 3… per user).
25 rows with columns user_id, login_date, streak_no — first 3 shown:
| # | |||
|---|---|---|---|
| 1 | 3 | 2025-01-02 | 1 |
| 2 | 3 | 2025-01-03 | 1 |
| 3 | 3 | 2025-01-04 | 1 |
Run your code to see the output here.