WHERE clause and grouped inequality using AND logical operator
On the other hand the following query using NOT and equality is giving me the expected result
AND NOT (field1 = 'Stop' AND field2 = 'Break')
The equivalent query(*):
SELECT *
FROM foo
WHERE (id = 23493132)
AND (field1 != 'Stop' OR field2 != 'Break');
(*) Assuming that field1/field2 are not nullable.
De Morgan's Law:
the negation of a conjunction is the disjunction of the negations
NOT (A AND B) <=> (NOT A) OR (NOT B)