I appreciate your effort, this is my solution :
declare @minYear nvarchar(4) = '2000' , @maxYear nvarchar(4) = datepart(year,getdate()), @counter int = 1, @howManyYearsPerGroup tinyint = 10; DECLARE @yearTable TABLE(rowNumber int, years nvarchar(4)) ;with CTE AS
(SELECT datepart(year,
@minYear) AS yr
UNION
allSELECT yr + 1
FROM CTE
WHERE yr < datepart(year,
@maxYear)) INSERT INTO @yearTableSELECT ROW_NUMBER()
OVER (ORDER BY YR) AS RowNumber, *
FROM cte DECLARE @ntile int SET @ntile =
(SELECT count(1)
FROM @yearTable) / @howManyYearsPerGroup ;WITH myCTE AS
(SELECT NTILE(@ntile)
OVER (ORDER BY rownumber) myGroup,years
FROM @yearTable )
SELECT CONCAT(min(years),
' - ',max(years)) AS ListOfYears
FROM myCTE
GROUP BY myGroup
ORDER BY myCTE.myGroup DESC