Najprostszym sposobem jest not exists lub left join :
select u.*
from users u left join
addresses a
on a.username = u.username and
a.city = 'Peoria'
where a.city is null;
left join przechowuje wszystkie rekordy w użytkownikach i wszelkie rekordy w addresses które pasują do on warunki. W tym przypadku (ponieważ nazwa miasta jest w on warunek), zwraca wszystkich użytkowników z informacją o miastach lub NULL wartości. where klauzula wybiera NULL wartości -- te niepasujące.
Odpowiednik not exists może być łatwiejszy do naśladowania:
select u.*
from users u
where not exists (select 1
from addresses a
where a.username = u.username and
a.city = 'Peoria'
);