Tech Junkie Blog: SQL: The IN Operator

Sunday, June 19, 2016

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

2 comments:

  1. Awesome. I am a beginner and this article helped me to resolve the problem .Thank you author and the whole expect team.

    http://www.wikitechy.com/view-article/what-is-sql-operator-with-examples-and-explanation


    Both are really good,
    Cheers,
    Venkat


    ReplyDelete
  2. Awesome. I am a beginner and this article helped me to resolve the problem .Thank you author and the whole expect team.

    http://www.wikitechy.com/view-article/what-is-sql-operator-with-examples-and-explanation


    Both are really good,
    Cheers,
    Venkat


    ReplyDelete