clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335815 fiddles created (27458 in the last week).

CREATE TABLE YourTable ( Date date NOT NULL );
 hidden batch(es)


INSERT INTO YourTable (Date) VALUES ('2021-07-28') , ('2021-07-27') , ('2021-07-26') , ('2021-07-25') , ('2021-07-24') , ('2021-07-23') , ('2021-07-22') , ('2021-07-21') , ('2021-07-18') , ('2021-07-17') , ('2021-07-14') , ('2021-07-11') , ('2021-07-09') , ('2021-07-06') , ('2021-07-04') , ('2021-07-03') , ('2021-07-02') ;
 hidden batch(es)


WITH partitioned AS ( SELECT * , DATEDIFF(Date, '1970-01-01') - ROW_NUMBER() OVER (ORDER BY Date ASC) AS PartID FROM YourTable ) SELECT MIN(Date) AS StartDate , COUNT(*) AS DayCount FROM partitioned GROUP BY PartID HAVING COUNT(*) > 1 ORDER BY PartID ;
StartDate DayCount
2021-07-02 3
2021-07-17 2
2021-07-21 8
 hidden batch(es)