MySQL NOT IN() ensures that none of the values in the arguments are present in the following expression.
SELECT FROM contacts WHERE first name NOT IN This MySQL NOT example would return all rows from the contacts table with a first name that is not Joseph, Andrew, or Brad.
According to the syntax above, the MySQL IN operator returns an equal value in the arguments. The IN keyword is used in conjunction with the WHERE clause.
NOT IN can't compare NULL values because it doesn't have that capability. In such instances, Not Exists is recommended. The query performs nested full table scans when "NOT IN" is used. The query can employ an index within the sub-query for "NOT EXISTS."