The NOT Operator

The NOT operator is used in combination with other operators to give the opposite result, also called the negative result.

SELECT column1, column2, ...
FROM table_name
WHERE NOT condition;
  1. The NOT LIKE

SELECT * FROM Customers
WHERE CustomerName NOT LIKE 'A%';
  1. NOT BETWEEN

SELECT * FROM Customers
WHERE CustomerID NOT BETWEEN 10 AND 60;
  1. NOT IN

SELECT * FROM Customers
WHERE City NOT IN ('Paris', 'London');
  1. NOT Greater Than

SELECT * FROM Customers
WHERE NOT CustomerID > 50;
  1. NOT Less Than

SELECT * FROM Customers
WHERE NOT CustomerId < 50;

Last updated