NOT (Transact-SQL)
SQL Server 2005
Negates a Boolean input.
Transact-SQL Syntax Conventions
- boolean_expression
-
Is any valid Boolean expression.
The following example finds all Silver colored bicycles that do not have a standard price over $400.
USE AdventureWorks; GO SELECT ProductID, Name, Color, StandardCost FROM Production.Product WHERE ProductNumber LIKE 'BK-%' AND Color = 'Silver' AND NOT StandardCost > 400; GO
Here is the result set.
ProductID Name Color StandardCost --------- ------------------- ------ ------------ 984 Mountain-500 Silver, 40 Silver 308.2179 985 Mountain-500 Silver, 42 Silver 308.2179 986 Mountain-500 Silver, 44 Silver 308.2179 987 Mountain-500 Silver, 48 Silver 308.2179 988 Mountain-500 Silver, 52 Silver 308.2179 (6 row(s) affected)
Reference
Expressions (Transact-SQL)Functions (Transact-SQL)
Operators (Transact-SQL)
SELECT (Transact-SQL)
WHERE (Transact-SQL)