1
SELECT company_name
FROM empl_company s
WHERE NOT EXISTS 
(
    (SELECT city
     FROM empl_company
     WHERE company_name = 'Small Bank Corporation'
     )
     EXCEPT
    (SELECT city
     FROM empl_company k
     WHERE k.company_name = s.company_name
     ) 
);

我变成了一个错误 ORA-00907:缺少右括号,谁能告诉我有什么问题?

4

2 回答 2

4

运算符在 Oracle中EXCEPT调用;MINUS

select company_name
from empl_company s
where not exists (
  select city
  from empl_company
  where company_name = 'Small Bank Corporation'
  MINUS
  select city
  from empl_company k
  where k.company_name = s.company_name
);
于 2012-10-21T17:18:55.197 回答
0

从不存在的emp1_company s中选择company_name(从emp1_company中选择城市,其中company_name ='Small Bank Corporation'和城市(从empl_company k中选择城市k.company_name = s.company_name));

于 2012-11-02T10:53:52.260 回答