每个班的前10名的MySQL 查询方法

 

  1. select a.class,a.score
  2.  
    from student a
  3.  
    where (select count(*) from student where class=a.class and a.score<score)<3
  4.  
    order by a.class,a.score desc;
  5.  

猜你喜欢

转载自www.cnblogs.com/wangchao422/p/9484740.html