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
所選。