SQL 练习1
- 查询" 01 "课程比" 02 "课程成绩高的学生的信息及课程分数
SELECT sname,sage,class1,class2 from Student,
(SELECT t1.sid,t1.class1,t2.class2 from
(select sid,cid,score as class1 from sc WHERE cid = '01') as t1,
(select sid,cid,score as class2 from sc WHERE cid = '02') as t2
WHERE t1.sid = t2.sid AND t1.class1 >t2.class2) as s WHERE Student.SId = s.sid
- 查询结果
本文来自博客园,作者:弩哥++,转载请注明原文链接:https://www.cnblogs.com/bangbangzoutianya/p/15156388.html