select * from 学生信息表 a 

where 10 >  (select count(*) from 学生信息表 where 班级ID = a.班级ID and 班内名次 > a.班内名次)