Tags / row-number
Recursive CTEs, Row Numbers, and Partitioning: A Powerful Combo for Gaps-and-Islands Problems
Identifying First Matches: 3 Approaches to Filter Records in T-SQL
Resetting Row Numbers Every Two Hours in SQL Using Window Functions
SQL Query Update: Using CTE to Correctly Calculate OverStaffed Values