1Used alongside a WHERE clause as a shorthand for multiple OR conditions.
2So instead of:
3SELECT * FROM users
4WHERE country = 'USA' OR country = 'United Kingdom' OR
5country = 'Russia' OR country = 'Australia';
6You can use:
7SELECT * FROM users
8WHERE country IN ('USA', 'United Kingdom', 'Russia',
9'Australia');
1
2(IN) operator in sql like "OR" operator
3For example:
4Select * From employees
5Where department_id "IN" (60,90);
6
1SQL NOT IN operator is used to filter the result if the values that are mentioned as part of the IN operator is not satisfied. Let’s discuss in detail about SQL NOT IN operator.
2
3Syntax:
4SELECT Column(s) FROM table_name WHERE Column NOT IN (value1, value2... valueN);
1SELECT Id, FirstName, LastName, Country FROM Customer WHERE Country IN (SELECT Country FROM Supplier)