@s < 5 控制多少个月
SELECT
DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL @s :=@s + 1 MONTH),'%Y-%m') AS `mon`
FROM
mysql.help_topic,
(SELECT @s := -1) temp
WHERE
@s < 5
ORDER BY mon
@s < 5 控制多少个月
SELECT
DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL @s :=@s + 1 MONTH),'%Y-%m') AS `mon`
FROM
mysql.help_topic,
(SELECT @s := -1) temp
WHERE
@s < 5
ORDER BY mon