# 查询“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语句执行会报错,自己没有找出错误原因,请教大家
题主,贴下报错信息还有表结构看看。
执行了你的sql 没有报错 都可以执行
你好,我是问答小助手。为了技术专家团可以更好地为您解答问题,烦请您补充下(1)问题背景详情,(2)您想解决的具体问题,(3)相关图片,便于技术专家团更好地理解问题,并给出解决方案。
您可以点击问题下方的【编辑】,进行补充修改问题。