This advanced SQL exercise is part of the book: Advanced SQL – Practical Techniques and Use-Cases, which includes 100 day-to-day SQL challenges (and solutions), need-to-know advanced features, and key concepts.
Given the following table. This table specifies the progress of a team that develops a certain product over two weeks. You can see that on January 1st, a day of progress has been recorded, followed by 5 days of no progress (pending), then another 3 days of progress, and again a single day of no progress (pending), and so on.
In this case you can see that the longest range of days during which a successive progress has been recorded is 3.
CREATE TABLE work_progress (p_date date, p_status varchar(25)) GO