using IN clause to provide a list of values for Search Criteria

In SQL Server , you can use the IN clause to providing the list of values for a search criteria.

For example , you want to display the employee records who’s job title is one of the following : ‘Design Engineer’,’Tool Designer’.

use AdventureWorks2014
GO
SELECT * FROM HumanResources.Employee
WHERE JobTitle IN ('Design Engineer','Tool Designer')
using IN clause to provide a list of values for Search Criteria


The above query uses the IN clause to filter the employee records using the arbitrary list of values.

Alternatively , you can also use the NOT IN clause to filter the records that does not match the list of values.

%d bloggers like this: