SQL NOT

The NOT operator in SQL is used to negate a condition. It is used to select records where the specified condition is not true.

Syntax


SELECT column1, column2, ...
FROM table_name
WHERE NOT condition;

        
  • condition – Specifies the condition that is negated by the NOT operator.

Example


SELECT Name, Age, Salary
FROM Employees
WHERE NOT Age < 25;

        

In this example:

  • The query selects records from the Employees table where the Age is not less than 25.