select (EXISTS (from s where NOT EXISTS (from t where s.id=t.id))) or (EXISTS (from t where NOT EXISTS (from s where s.id=t.id)) );