sqlbelle.com
Getting maximum consecutive years in T-SQL using Common Table Expressions (CTE)
This is an expansion (and slight variation) of Joe’s answer in StackOverflow regarding the thread Find the maximum consecutive years for each ID’s in a table (Oracle SQL) using SQL Serv…