-- 单科最高分是谁
select * from topn where sco in (select max(sco) from topn group by clsno);
-- 单科最高分是谁
select * from topn a
where not exists (select * from topn where ClsNo=a.ClsNo and sco>a.Sco);
-- 单科前两名
select * from topn a where 2>(select count(*) from topn b where a.ClsNo=b.clsno and sco>a.Sco)
order by a.ClsNo ,a.Sco desc;