读书人

两个not exist有关问题

发布时间: 2012-12-17 09:31:40 作者: rapoo

两个not exist问题
学生表(学号,名字)student(sno,sname)
选课表(学号,课程号)sc(sno,cno)
课程表(课程号,课程名)course(cno,cname)
注:不是每个学生都会选课
查询选修了全部课程的学生姓名
书上的代码为
select sname
from student
where not exists
(select *
from course
where not exists
(select *
from sc
where sno=student.sno
and cno=course.cno))

读书人网 >oracle

热点推荐