数据库
首页 > 数据库> > MySQL及SQL SERVER获取连续时间实例

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'

 

标签:help,05,mysql,MySQL,number,SERVER,topic,SQL
来源: https://www.cnblogs.com/Nakago/p/16420363.html