# 查询“1”课程比“2”课程成绩高的所有学生的学号;
我写的:
select a.sno from (select sno,cno,score from sc where cno=1) a, (select sno,cno,score from sc where cno =2) b where a.sno = b.sno AND a.score > b.score;
正确答案:
SELECT a.sno FROM sc a, sc b WHERE a.sno = b.sno AND a.cno = 1 AND b.cno = 2 AND a.score > b.score;
为什么“我写的”sql语句执行会报错,自己没有找出错误原因,请教大家