摘要:
查询各科成绩前三名的记录 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 阅读全文
摘要:
统计各科成绩各分数段人数:课程编号,课程名称,[100-85],[85-70],[70-60],[60-0] SELECT Course.CId,Course.Cname ,t.[0-60],t.[60-70],t.[70-85],t.[85-100] from Course, ( SELECT c 阅读全文
摘要:
按各科成绩进行排序,并显示排名, Score 重复时保留名次空缺 SELECT t.cid,t.sid,t.score ,COUNT(t1.score)+1 as 排名 from sc as t LEFT JOIN SC as t1 ON t.cid = t1.CId AND t.score < t 阅读全文