-
NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: SQL Server
-
NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: PostgreSQL
-
NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: Oracle
-
NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: MySQL
In a nutshell:
NOT IN is a little bit different: it never matches if there is but a single NULL in the list.
-
In
MySQL,NOT EXISTSis a little bit less efficient -
In
SQL Server,LEFT JOIN / IS NULLis less efficient -
In
PostgreSQL,NOT INis less efficient -
In
Oracle, all three methods are the same.