1

所以我必须 - 列出从未执导过“派拉蒙影业”电影的导演的directorID。

这些表是 Movieinfo(mvid, title, rating, year, length, studio) directinfo(mvid, directorID)

select distinct directorID
from movieinfo natural join directinfo
where studio <> 'Paramount Picture';

不起作用,因为它显示了导演已经完成了最重要的电影,然后是没有最重要的电影。所以我尝试使用存在,不存在,在,而不是,但我不断地找到以前与派拉蒙合作过的导演。

任何帮助将不胜感激。

4

2 回答 2

1
select distinct d.directorID
from directinfo as d
where d.directorId not in
                  (select distinct d1.directorId 
                  from movieinfo as m
                  inner join directinfo as d1 on d1.mvid = m.mvid
                  where m.studio =  'Paramount Picture');
于 2013-05-27T06:37:03.150 回答
-1
 select distinct directorid from 
  directorinfo where 
  mvid not in 
( select mvid from movieinfo where studio<>'paramount')
于 2013-05-27T06:43:15.900 回答