The NOT logical operator reverses a Boolean condition, turning true into false and false into true.
NOT allows analysts to express exclusion rules and select records that do not satisfy a specified condition.
Find employees who are not in the Finance department.
SELECT
EmployeeName,
Department
FROM Employees
WHERE NOT Department = 'Finance';
NOT is useful for exclusion rules, exception reporting, data validation, and filtering unwanted categories.
- NOT reverses a condition.
- It can be used with comparison conditions.
- It supports exclusion logic.
- It can be combined with AND and OR.
- NOT IN and NOT LIKE are common related forms.
What does NOT do?
NOT reverses the logical result of a condition.
What is a common use of NOT?
NOT is commonly used to exclude records that match a specified condition.