考虑以下问题:我们有3个表,
例如:[1,HarryPotter],[2,HarryPotter],[3,海盗卡尔]
之前已回答过这个问题。 How to solve the following nested query?
答案 0 :(得分:1)
使用相同的公式而不考虑逻辑但使用EXISTS而不是IN
select distinct movie_name
from Movies m
where EXISTS (
select 1
from ShowTime t
where m.movie_id = t.movie_id
group by movie_id
having count(distinct theatre_Id) = (select count(*) from Theatre))