SQL NOT
The NOT Operator
The NOT operator is used in combination with other operators to give the opposite result, also called the negative result.
Syntax
SELECT column1, column2, …
FROM table_name
WHERE NOT condition;
Example:
In the select statement below we want to return all customers that are NOT from Spain:
In the example above, the NOT operator is used in combination with the = operator, but it can be used in combination with other comparison and/or logical operators. See examples below.
NOT LIKE
Example:
Select customers that does not start with the letter ‘A’
NOT BETWEEN
Example:
Get Elvan Tektaş’s stories in your inbox
Join Medium for free to get updates from this writer.
Select products with a UnitPrice not between 20.00 and 50.00
NOT IN
Example:
Select customers that are not from Germany or Spain
NOT Greater Than
Example:
Select Products with a UnitPrice not greater than 50.00
NOT Less Than
Example:
Select Products with a UnitPrice not less than 50.00






