Tech Junkie Blog - Real World Tutorials, Happy Coding!: SQL: The NOT IN Operator

Tuesday, May 25, 2021

SQL: The NOT IN Operator

The NOT IN operator in SQL means that you are retrieving records in the database that does not match the values in a comma separated list. In other words it retrieves the inverse of the IN statement by itself. Here is an example of how you can use the IN operator in the products table in the Northwind database.

SELECT * 
FROM Products
WHERE SupplierID NOT IN (1,2)

The above example all the products will be retrieved except for products with SupplierID of 1 or 2, here are the results



SQL results from NOT IN operator


Similar Posts:



2 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. The NOT IN operator in SQL means that you are retrieving records in the database that does not match the values in a comma separated list. In other words it retrieves the inverse of the IN statement by itself. Here is an example of how you can use the IN operator in the products table in the Northwind database.
    positivity blossom quotes
    cricut wine bottle labels
    meaningful heart beat tattoo
    cricut vinyl cutter
    cricut animal designs
    cricuit designs
    cricut vinyl for walls

    ReplyDelete