SELECT * FROM sp WHERE NOT EXISTS ( SELECT 1 FROM supplier -- note SP doesn't appear here! WHERE supplier.num = sp.num -- sp is from main query )