Reputation: 809
I have a table in DB like that
i want to select all except the record contain (x=1, y=1) i mean the id=8
id | x | y
---------------
1 | 2 | 1
2 | 0 | 1
3 | 5 | 6
4 | 6 | 4
5 | 7 | 4
6 | 7 | 4
7 | 5 | 7
8 | 1 | 1
Upvotes: 0
Views: 413
Reputation: 2578
Following doctrine should work for you.
Doctrine_Query::Create() ->from("tablename") ->where("x != 1 AND Y != 1") ->fetchArray();
Upvotes: 1
Reputation: 1617
try this
SELECT * FROM test where 1 NOT IN(x) OR 1 NOT IN (y)
see demo... http://www.sqlfiddle.com/#!2/dd008/12
Upvotes: 0
Reputation: 16086
you can try this-
select * from TableName where x!=1 and y!=1
Upvotes: 0