Tags / gaps-and-islands
Merging Overlapping Date Ranges in SQL Server 2014
Creating Groupings Based on Unique Combinations of MEM_ID, PROV, and ADM_DT in SQL
Combining Duplicate Records Based on Column Combinations: A SQL Approach
Summing Over Rows Based on Column Value Using PostgreSQL Window Functions
SQL Window Functions for Aggregate Calculations with the COALESCE and MAX Approach
Splitting a Column Value into Two Separate Columns in MySQL Using Window Functions
SQL Join Against Date Ranges: Exploring Consecutive Dates with LAG, DATEDIFF, and Grouping