Negates a Boolean input.
[NOT] boolean_expression
Boolean
NOT reverses the value of any Boolean expression.
The use of NOT negates an expression.
This table shows the results of comparing TRUE and FALSE values using the NOT operator.
NOT | |
---|---|
TRUE | FALSE |
FALSE | TRUE |
UNKNOWN | UNKNOWN |
This example finds all business and psychology books that do not have an advance over $5,500.
USE pubs
GO
SELECT title_id, type, advance
FROM titles
WHERE (type = 'business' OR type = 'psychology')
AND NOT advance > $5500
ORDER BY title_id ASC
GO
Here is the result set:
title_id type advance
-------- ------------ ---------------------
BU1032 business 5000.0000
BU1111 business 5000.0000
BU7832 business 5000.0000
PS2091 psychology 2275.0000
PS3333 psychology 2000.0000
PS7777 psychology 4000.0000
(6 row(s) affected)
Expressions | SELECT |
Functions | WHERE |
Operators (Logical Operators) |