需要一段时间内的每一天的日期,结果示例
执行sql
select
date_format(b,'%Y%m') ,date_format(b,'%Y%m%d') day1
from (
select
365-help_topic_id,
DATE_SUB(date_format('2023.06.01','%Y.%m.%d'),INTERVAL help_topic_id DAY ) b
from mysql.help_topic
order by help_topic_id
limit 365) tab
where b>='2023-01-01'