SELECT
DATE_FORMAT(
date_add(
last_day("2021-02-01"),
INTERVAL (
cast(
help_topic_id AS signed INTEGER
) - DAY (last_day("2021-02-01"))
) + 1 DAY
),
'%Y-%m-%d'
) DAY
FROM
mysql.help_topic
WHERE
help_topic_id < DAY (last_day("2021-02-01"))
ORDER BY
help_topic_id
查询结果可以作为中间结果集,作为其他表的关联条件