求教一条sql语句
ygnmn 2012-09-19 03:56:38 --42、查询每门功成绩最好的前两名
select t.* from sc t where score in (select top 2 score from sc where C = T.C order by score desc) order by t.C , t.score desc
小弟理解不了请各位大虾解释下,能不能有代替的好理解的语句,
sc 成绩表 包括 s 学号 c 课程 score 成绩三个字段
这种自查寻得方法小弟一直没理解透彻,请各位大虾帮忙