यह पुनरावर्ती CTE का उपयोग करते हुए 2004 से वर्तमान तक के सभी वर्षों को प्राप्त करता है:
with yearlist as
(
select 2004 as year
union all
select yl.year + 1 as year
from yearlist yl
where yl.year + 1 <= YEAR(GetDate())
)
select year from yearlist order by year desc;