php - Omit all result if one row is equal to a certain value -


i want select row (that appears multiple times) table if column 'wrong' never reads "yes".that means if row exists 100 times , only 1 time wrong=yes, no display rows in result.

*and if possible no variables , while loops please. if can't done, go ahead , post solution variable.

here example of table structure:

table 1

user--wrong--othercolumns bob              data    bob              data  bob              data  bob              data      bob              data bob   yes        data bob              data  bob              data  jon              data  

result should be: jon (because 1 time wrong equal yes user bob)

this code ofcourse doesn't omit bobs. 1 omitted:

select user table1 wrong <> 'yes' 

select * table1 t1 not exists   (select 1    table1 t2    t1.user = t2.user    , wrong = 'yes'); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -