I have the following table:
ID | JobID | Data | ResultType --------------------------------- 1 | 12345 | XXXX | 0 2 | 12345 | YYYY | 1 3 | 23456 | A
Another way (not tested):
SELECT JobId FROM Jobs GROUP BY jobId HAVING max(ResultType) = 0