SQL 练习20
- 查询各科成绩前三名的记录
select a.sid,a.cid,a.score from sc a
left join sc b on a.cid = b.cid and a.score<b.score
group by a.cid, a.sid,a.score
having count(*)<3
order by a.cid,a.score DESC
本文来自博客园,作者:弩哥++,转载请注明原文链接:https://www.cnblogs.com/bangbangzoutianya/p/15166582.html