SQL Server IN keyword is use to extend the filter on select statement.
In keyword we use when we need select data from multiple options.
We have to provide the value in comma (,) separate format in IN keyword and
SQL Sever check the data from given values.
Let consider below list of shopping items and we are going to apply IN keyword in this table.
Select the product from Shopping table where dealer country from (in) USA, China and Japan.
Example
Output
Select the product from Shopping table where dealer country not from (not in) USA, China and Japan.
Example
Output
Note : Use the single cote for string values IN clause and for number use the direct values no need to give the single cote values.
String Example : Country IN ('USA' ,'China','Japan')
Number Example : Class IN (10,12)