2个回答
展开全部
select student.SId from (select SId,Score from SC where CId=1)student ,(select sid,Score from SC where CId=2)score
where student.Score>score.Score and student.SId=score.SId
SELECT student.SId
FROM ( SELECT SId ,
Score
FROM SC
WHERE CId = 1
) student , --查询出课程一的成绩
( SELECT sid ,
Score
FROM SC
WHERE CId = 2
) score --查询出课程二的成绩
WHERE student.Score > score.Score --查询出课程一比课程二高的成绩学生id
AND student.SId = score.SId; --同一个学生
where student.Score>score.Score and student.SId=score.SId
SELECT student.SId
FROM ( SELECT SId ,
Score
FROM SC
WHERE CId = 1
) student , --查询出课程一的成绩
( SELECT sid ,
Score
FROM SC
WHERE CId = 2
) score --查询出课程二的成绩
WHERE student.Score > score.Score --查询出课程一比课程二高的成绩学生id
AND student.SId = score.SId; --同一个学生
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2018-12-03
展开全部
SELECT s1.[Sid]
FROM [SC] s1
inner join [SC] s2 on s1.[Sid] = s2.[Sid] and s2.Cid = 'A02' and s1.score > s2.score and s1.Cid = 'A01'
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询