select date_format(curdate(),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 1 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 2 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 3 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 4 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 5 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 6 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 7 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 8 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 9 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 10 month),'%Y-%m') AS `mon` union
select date_format((curdate() - interval 11 month),'%Y-%m') AS `mon`
執行結果:

CURDATE() 函數返回當前的日期
UNION 操作符用於連接兩個以上的 SELECT 語句的結果組合到一個結果集合中。多個 SELECT 語句會刪除重復的數據
