In MySQL NOT
operator is used to negate a condition in a SELECT, INSERT, UPDATE or DELETE statement. In other words, MySQL NOT condition is opposite of MySQL IN
condition, it is
fetch a record if the condition(s) is NOT TRUE.
To reduce the use of multiple OR conditions, use the following syntax:
Parameters:
tablename: The table name from which you want to perform NOT
operator.
condition: Specifies the conditions that you want to negate.
NOT
operator is used to fetch a records if the condition(s) is NOT TRUE:
Note:
In the above example, we are performing NOT
operator to fetch a records if the condition(s) is NOT TRUE.
You can use MySQL Command Line Client to perform NOT
operator to negate a condition. It will look like this:
IN
operator to fetch a records if the condition(s) is NOT TRUE, then the IN operator will evaluate to true:
Note:
In the above example, we are performing NOT
operator with IN
operator to fetch a records if the condition(s) is NOT TRUE.
You can use MySQL Command Line Client to perform NOT
operator with IN
operator to negate a condition. It will look like this: