How do I select distinct rows where a column may have a number of the same values but all their 2nd

Posted by Martin Rose on Stack Overflow See other posts from Stack Overflow or by Martin Rose
Published on 2010-05-11T17:30:35Z Indexed on 2010/05/11 17:34 UTC
Read the original article Hit count: 230

Filed under:
|

I have a table in the form:

test_name| test_result |
test1 | pass |
test2 | fail |
test1 | pass |
test1 | pass |
test2 | pass |
test1 | pass |
test3 | pass |
test3 | fail |
test3 | pass |

As you can see all test1's pass while test2's and test3's have both passes and fails.

Is there a SQL statement that I can use to return the distinct names of the tests that only pass? E.g. test1

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql