
SQL - IN & NOT IN CLAUSE
SQL IN operator is used to allow multiple value in a WHERE clause condition. It is similar to having MULTIPLE OR conditions
SQL IN CLAUSE
SYNTAX

EXAMPLE
Let’s fetch all the data from Persons table in our Demo Database where city is Bangalore or Pune:
SELECT * FROM PERSONS;

Figure 17.1. IN CITY (PUNE, MUMBAI)
SQL NOT IN operator is used to exclude multiple value in a WHERE clause condition. It is similar to a NOT condition.
SQL NOT IN
SYNTAX

EXAMPLE
Let’s fetch all the data from Persons table in our Demo Database where city is not Bangalore or Pune:
SELECT * FROM PERSONS;

PRACTICE YOURSELF

Want More SQL Deep Dives