select course_id
from course
where exists
(select course_id
from course
where course_id not in
(select course_id
from section));
2.
select course_id
from course
where course_id not in
(select course_id
from section);
我想检索表course
没有出现在表section
每course_id
。第一个结果在200;第二个结果在115. 为什么这两个有不同的结果?
我解释第一个,我将检查course
中是否有course_id
不属于section
。如果存在返回true,那么之前检查的course_id
是course_id
所选。