SQL Server 求结果

;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

posted @ 2015-11-09 07:55  点滴成事  阅读(169)  评论(0编辑  收藏  举报