exists
和not exists
: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'
)