How to Find Consecutive Dates in SQL
A product manager once asked me for a list of users who had logged in five days in a row, so the team could send them a loyalty reward. An analyst had already tried. The query joined the login table to itself five times, took several minutes on a table with a few million rows, … Read more