MySQL及SQL SERVER获取连续时间实例

--MySQL
select ('2022-05-05'+interval(cast(mysql.help_topic.help_topic_id as signed)) day) as 'DAY' from mysql.help_topic HAVING (DAY <= date_FORMAT('2022-07-05','%Y-%m-%d')) order by DAY 
--SQL Server
select convert(varchar(10),dateadd(day,number,'2022-05-01'),120) as [Date] from master..spt_values    where number>=0 and type='p'

 

posted @ 2022-06-28 17:30  StarFox  阅读(25)  评论(0编辑  收藏  举报