1、先取一个新表sc1,左连接至原表,对degree栏做比较,条件为sc1.kemu=sc2.kemu and sc1.degree
select sc1.sno,sc1.kemu,sc1.degree from score sc1 where(selectcount(1)from score sc2 where sc1.kemu=sc2.kemu and sc1.degree<sc2.degree)<2 orderby sc1.kemu,sc1.degree desc
select student.sno,student.sname,a.kemu,a.degree from student innerjoin (select sc1.sno,sc1.kemu,sc1.degree from score sc1 where(selectcount(1)from score sc2 where sc1.kemu=sc2.kemu and sc1.degree<sc2.degree)<2orderby sc1.kemu,sc1.degree desc)as a on student.sno=a.sno orderby a.kemu,a.degree desc