質問にあるすべての企業検索: を企業はいくつかの都市に位置することができると仮定します。 「Small Bank Corporation」が所在するすべての都市にあるすべての企業を検索します。
回答:
Select S.company_name
from company S
where not exists
(select city
from company
where company_name = 'Small Bank Corporation'
except
(select city
from company T
where S.company_name = T.company_name
)
)
私はこれを読んでいる方法
: は、テーブルSに配置されていない「小バンク株式会社」の 都市が存在しないすべての企業 を選択し、 T)。
ただし、S.company_name
は同じテーブルの重複であるため、常にT.company_name
となりますか?
私は解決策を理解する助けを求めています。
説明ありがとうございます!