# 借助mysql.`help_topic`表
SELECT DATE_ADD(CURDATE(),INTERVAL b.`help_topic_id`+1 DAY) AS dates
FROM mysql.`help_topic` b
WHERE b.`help_topic_id`<30
-- ----------------------------------------
# 使用变量
set @a=0;
SELECT DATE_ADD(CURDATE(),INTERVAL @a:=@a+1 DAY) AS dates
FROM mysql.`help_topic` b # 此处任意表都可,但日期显示数量受表的数据条数影响;
WHERE @a<30
SQL产生连续日期
最新推荐文章于 2024-10-10 10:27:31 发布