需求:有一个起始时间,比如2008年1月1日-2024年12月1日,需要按月列举出每一个月的日期,
目前有一个简单的笨办法,通过mysql.help_topic的id自增来列举
SELECT DATE_FORMAT( date_add(concat('2008-01-01'), interval(help_topic_id) MONTH),'%Y-%m-%d') DT
FROM mysql.help_topic
WHERE help_topic_id <= timestampdiff(DAY,concat('2019-01-01'),concat('2019-07-23'))