If you want just the
TestNames you can
group by testname and set the condition in the
select TestName from tablename group by TestName having sum(Result <> 'FAIL') = 0
If you want all the rows for the
TestNames that never passed, you can use
select t.* from tablename t where not exists (select 1 from tablename where TestName = t.TestName and Result <> 'FAIL')
See the demo.
CLICK HERE to find out more related problems solutions.