代码:
SELECT DATE_FORMAT(DATE_ADD(CONCAT(DATE_FORMAT(CURDATE(), "%Y-%m-01")),INTERVAL (CAST(help_topic_id AS SIGNED)) DAY),'%Y-%m-%d') as DATE
FROMmysql.help_topic
WHERE help_topic_id < TIMESTAMPDIFF(DAY, CONCAT(DATE_FORMAT(CURDATE(), "%Y-%m-01")),CONCAT(STR_TO_DATE(CURDATE(), '%Y-%m-%d')))
效果: