加上排序
select * from (SELECT year([date]) as year,month([date]) as month from 表名 group by year([date]),month([date])) as a order by a.[year] desc,a.[month] desc
你上面的那种结构估计不能实现
SELECT year([date]) as year,month([date]) as month from 表名 group by year([date]),month([date])
这条语句能实现以下结构
year month
2005 3
2005 2
2004 12
2003 3
2003 8
2002 4
2002 10