SQL: The IN Operator

The IN operator in SQL means that you are retrieving records in the database that matches the values in a comma separated list. 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 IN (1,2)

In the above example all the products with the SupplierID of 1 or 2 are retrieved.

SQL results from IN operator query

Comments

Popular posts from this blog

Docker : Adding Docker Repository Key and Updating Docker To The Latest Version

ASP.NET Core : Add jQuery, Bootstrap, AngularJS Using bower.json

ASP.NET Core : Adding The Default View With _ViewStart.cshtml