实际情况是,我将输入作为年份提供给预测数据。假设ForecastYear是2016。
那么结果应该是
-------------
ForecastYear
-------------
2014
2015
2016
-------------
Declare @toyear int=2016
;with CTE as
(
select year(getdate()) years
union all
select years+1 from cte where years<@toyear
)
select * from cte
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句