MYSQL數據庫中有一張學生成績表數據庫
表名:tabletable
字段: student(學生), class(班級), total(總分)class
字段說明: 班級取值範圍 1-10,一共10個班。select
請用SQL查出每一個班級的前三名數據
select *
from tb t
where (select count(1)+1 from tb where class=t.class and marks>t.marks)<=3;tab
select *
from tb t;co