hardStudy question · answer published in SQL interview questions, so no pointswindow-functionssqlgaps-and-islands
Streaks broken by repeat logins
A login streak query uses login_date - ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY login_date). Users who log in twice on some days get wrong streaks. What fixes it?
Discussion 0
Join free to post in the discussion.