distinct query mysql, no failed rows
Posted: Thu Apr 26, 2007 2:45 am
hello out there,
I have this big challenge, i'm looking for a way to query the database table while checking for specific condition using the where phrase. the hard part is, the query is base on the != operator. As to be true it shouldn't be equal. HOwever, i also would like the result to be exclusively,extremely unique and true. what do i mean, several rows have same id for example if a column has a name "ninja" many times and the "ninja" id appears on some row and does not meet the condition, then i want all rows with "ninja" excluded from the result.
I have tried using i'm using php to query the database. stopped the row from being repeated but it produces rows that have ninja false somewhere.
note: if there is another to do this please let me know. all help will be appreciated
I have this big challenge, i'm looking for a way to query the database table while checking for specific condition using the where phrase. the hard part is, the query is base on the != operator. As to be true it shouldn't be equal. HOwever, i also would like the result to be exclusively,extremely unique and true. what do i mean, several rows have same id for example if a column has a name "ninja" many times and the "ninja" id appears on some row and does not meet the condition, then i want all rows with "ninja" excluded from the result.
I have tried using
Code: Select all
select DISTINCT id, name from table WHERE condition1 !=$con1 AND condition2 !=$con2Code: Select all
DISTINCTnote: if there is another to do this please let me know. all help will be appreciated