select t.*
from tourists t
where
exists (
select 1
from stay s
inner join hotels h on h.hcode = s.hcode
where s.tcode = t.tcode and h.name = 'Hilton'
) and not exists (
select 1
from stay s
inner join hotels h on h.hcode = s.hcode
where s.tcode = t.tcode and h.name = 'Continental'
)
1条答案
按热度按时间wpx232ag1#
你可以用
exists
以及not exists
: