This tutorial explains how to use the MySQL NOT condition with syntax and examples.
The MySQL NOT Condition (also called the NOT Operator) is used to negate a condition in a SELECT, INSERT, UPDATE, or DELETE statement.
The syntax for the NOT Condition in MySQL is:
Parameters or Arguments
The condition to negate.
The MySQL NOT condition requires that the opposite of the condition be must be met for the record to be included in the result set.
Example - Combine With IN condition
The MySQL NOT condition can be combined with the IN Condition.
This MySQL NOT example would return all rows from the contacts table where the first_name is not Joseph, Andrew, or Brad. Sometimes, it is more efficient to list the values that you do not want, as opposed to the values that you do want.