标签:
;with cte as (
select CONVERT(DATE, DATEADD(DAY, -9, GETDATE())) as paytime
union all
select dateadd(day,1,paytime) from cte where paytime<GETDATE()
)
select * from cte a
-----------猜猜结果是什么,下面的
paytime
2015-10-31
2015-11-01
2015-11-02
2015-11-03
2015-11-04
2015-11-05
2015-11-06
2015-11-07
2015-11-08
2015-11-09
2015-11-10
标签:
原文地址:http://www.cnblogs.com/theonewu/p/4948933.html