热线电话:13121318867

登录
2021-05-31 阅读量: 2298
如何查询各科成绩最高和最低的分:以如下形式显示:课程ID,最高分,最低分

SELECT L.C# As 课程ID,L.score AS 最高分,R.score AS 最低分


FROM SC L ,SC AS R


WHERE L.C# = R.C# and


L.score = (SELECT MAX(IL.score)


FROM SC AS IL,Student AS IM


WHERE L.C# = IL.C# and IM.S#=IL.S#


GROUP BY IL.C#)


AND


R.Score = (SELECT MIN(IR.score)


FROM SC AS IR


WHERE R.C# = IR.C#


GROUP BY IR.C#


);


55.8911
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子