IN operator is used to check if a given value is contained within a
set of values.
When you run a
query with the IN operator, the given column will be checked and if at least one value from the set of values is found, then the query will one or more records.
The SQLite IN syntax is as follows:
SELECT column_name1, column_name2, ... FROM table_name WHERE column_name IN (set_of_values);
Table of student_address
In the first example, the select returns records from the student_address table, if the address_id column will have values included in the given set.
SELECT * FROM student_address WHERE address_id IN (101,102);
The second example is similar to the first, the difference is that the city column will be checked. If at least one value from the set of values is found in the city column, then the select will return at least one record.
SELECT * FROM student_address WHERE city IN ('Boston','Seattle');