select s.*, c1.cno, c1.score, c2.cno, c2.score
from student s
join sc c1 on s.sno = c1.sno
join sc c2 on s.sno = c2.sno
where c1.cno = 1
and c2.cno = 2
and c1.score < c2.score;
总结
- 套路跟第一个题一样哈。
select s.*, c1.cno, c1.score, c2.cno, c2.score
from student s
join sc c1 on s.sno = c1.sno
join sc c2 on s.sno = c2.sno
where c1.cno = 1
and c2.cno = 2
and c1.score < c2.score;
总结