Tags / gaps-and-islands
Merging Overlapping Date Ranges in SQL Server 2014
How to Group SQL Records by Last Occurrence of ID: A Step-by-Step Solution
Finding Adjacent Vacations: A Recursive CTE Approach in PostgreSQL
Aggregating Length of Time Intervals and Grouping to Fixed Time Grid: A Step-by-Step Solution
Running Totals from Consecutive Columns: A Flexible Approach to Gaps and Islands
SQL Query to Calculate Sum of Values for Each User and Date, Treating Consecutive Days as a Single Day
Splitting a Column Value into Two Separate Columns in MySQL Using Window Functions
Finding Missing Numbers in a Sequence: A Recursive Approach