mysql 按类别之用一条SQL语句查询出每个班前10名学生数据 select * from 学生信息表 a where 10 > (select count(*) from 学生信息表 where 班级ID = a.班级ID and 班内名次 > a.班内名次)