sql查询某个学生没选的课程信息:C#, Cname ,Tname,

如题所述

第1个回答  2013-05-22
1、查询课程信息:select * from Course ,其中Course 就是课程表
2、某个学生没选:where not exists
3、学生选中的:select Cname from Student where Cname is not null,其中Cname就是课程名,Student就是学生表(因为你没有给详细信息,我不确定你的学生表是否有课程名这个字段,如果没有,只能通过连接查询,这里略)
4、综上:select * from Course where not exists (select Cname from Student Cname is not null)

不知道对不对,如果不对,盼望其他人帮忙解决
第2个回答  2013-05-22
select * from 课程信息表 where ID not in
(select 课程信息ID from 学生选课表 where 学生ID = 学生ID )
第3个回答  2013-05-22
select * from 表1 where (select C# from 表1,表2 where 表1.C# = 表2.C#) not in (select * from 表1)本回答被提问者采纳
第4个回答  2013-05-22
select Cname,Tname from 表名 where=学生学号
不明白你说的是不是这样子的查询语句
第5个回答  2013-05-22
详细点, 这样不太明白你的需求.
相似回答