Для измененного требования:
select * from tasks t
where exists (select null from locations l
where t.id = l.task_id and l.name in ('London', 'Geneva'...)) and
not exists (select null from locations l
where t.id = l.task_id and l.name not in ('London', 'Geneva'...))