SELECT * FROM( SELECT * FROM stu ORDER BY score DESC ) as a GROUP BY a.class ORDER BY score DESC
假如后面加limit 1,10 就是要取前10个,则想要的结果和本人预期的不一样(第一名没有了顺序也很怪,怀疑是不是先做了limit再排序的),求高手帮帮忙
SELECT * FROM( SELECT * FROM stu ORDER BY score DESC ) as a GROUP BY a.class ORDER BY score DESC limit 1,10
解决方案
20
10