There is a table of student grades in the MYSQL database
table name: table
Fields: student (student), class (class), total (total score)
Field description: Class ranges from 1 to 10, a total of 10 classes.
Please use SQL to find out the top three in each class
select *
from tb t
where (select count(1)+1 from tb where class=t.class and marks>t.marks)<=3;
select *
from tb t;