查询指定日期区间内的每一天

直接上代码。。。。

select   CONVERT(varchar(10), CONVERT(datetime, '2011-12-1')+d,120) as  [time]
                from
                (
                    select   top   (datediff(day,'2011-12-1','2011-12-31')+1)   row_number()   
                    over(order   by   getdate())-1   d   from   sys.objects
                ) as a

技术改变生活!
原文地址:https://www.cnblogs.com/grokyao/p/2314201.html