sql中生成365天语句

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-1 11:41   394   0
select dateadd (dd, number , cast ( DatePart ( year , getdate ()) as char ( 4 )) + ' -01-01 ' ) as 日期 from master..spt_values where type = ' p ' and number <= datediff (dd, cast ( DatePart ( year , getdate ()) as char ( 4 )) + ' -01-01 ' , cast ( DatePart ( year , getdate ()) as char ( 4 )) + ' -12-31 ' )
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP