注册 登录
编程论坛 SQL Server论坛

这SQL语句怎么写啊?

czs8281846 发布于 2009-10-15 21:02, 808 次点击
Student(S#,Sname,Sage,Ssex) 学生表
Course(C#,Cname,T#) 课程表
SC(S#,C#,score) 成绩表
Teacher(T#,Tname) 教师表

问题:
1、查询“001”课程比“002”课程成绩高的所有学生的学号;
4 回复
#2
Vitamin19992009-10-16 11:30
select c.S# from SC c  
join SC d on c.S# = d.S#  
where c.C# = '001' and c.score > d.score and d.C# = '002'
group by c.S#
#3
我是傻逼2009-10-16 20:49
2楼正解
#4
czs82818462009-10-16 21:20
回复 2楼 Vitamin1999
非常感谢…………
#5
我真是木小板2010-09-14 09:19
正解正解
1