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
Post a Comment