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.

An online gambling site manages the following table. This table documents the dates when an error has occurred in the system. As you can see, two days passed between error no. 1 and error number 2, 6 days passed between error number 2 and error number 3 and so on.

(id int identity(1,1),
fdate DATE)

Would you like to read more?