(Contents)(Previous)(Next)

Negative Conditions: NOT

To obtain the opposite of a condition, NOT must be placed before the relevant expression. The negation refers to the following expression. If a compound expression is to be negated, it must be enclosed in parentheses.

According to the part to be negated, the expression NOT x AND y OR z can be parenthesized in the following ways. Only the first two expressions are logically equivalent, i.e., have the same result.

NOT x AND y OR z

NOT (x) AND y OR z

or NOT (x AND y) OR z

or NOT (x AND y OR z),

SELECT name, city, state, zip

FROM customer

WHERE NOT (city = 'Dallas' OR

city = 'New York')


(Contents)(Previous)(Next)