以下是我的SQL查询
select c.course_id,c.course_title,c.course_credits,c.course_status from
course c,(select course_id from completed_course
where student_id='1229CSE00241') as a
where c.course_id!=a.course_id
但是它显示了所有课程但我只想要课程c 不属于a。
的课程答案 0 :(得分:4)
select
c.course_id,
c.course_title,
c.course_credits,
c.course_status
from course c
where
c.course_id NOT IN (select course_id from completed_course where student_id='1229CSE00241');
答案 1 :(得分:1)
select c.course_id,
c.course_title,
c.course_credits,
c.course_status
from course c where c.course_id not in
(select course_id from completed_course where student_id='1229CSE00241')