-
select
date_add(
curdate(),
interval(
cast(help_topic_id
as signed
integer) -
30)
day)
day
-
from mysql.help_topic
-
where help_topic_id <
day(
last_day(
curdate()))
-
order
by help_topic_id
2019-07-03更新进一步格式化版
SELECT
DATE_FORMAT( date_add( curdate( ), INTERVAL ( cast( help_topic_id AS signed INTEGER ) - 30 ) DAY ) , '%m/%d' ) DAY
FROM
mysql.help_topic
WHERE
help_topic_id < DAY ( last_day( curdate( ) ) )
ORDER BY
help_topic_id
原文地址:https://blog.csdn.net/qq_29384639/article/details/89563852