SQL IN Statement

The SQL IN statement with the IN operator is used to specify multiple values with the WHERE clause in a SQL statement.

SQL IN statement

SELECT column_name(s)
FROM table_name
WHERE column_name IN (value(s))

Database Table “Members”

Id FirstName LastName Email City Phone
1 Gilbert Duncan [email protected] Newark 973-600-3300
2 Elvis Daniels [email protected] Piscataway 862-600-3050
3 Michael Green [email protected] Detroit 732-500-5050
4 Kelvin Graham [email protected] Detroit 732-555-5050

SQL IN Example

SELECT *
FROM Members
WHERE FirstName IN (‘Gilbert’, ‘Michael’)

RESULT of SQL IN statement above will be

Id FirstName LastName Email City Phone
1 Gilbert Duncan [email protected] Newark 973-600-3300
3 Michael Green [email protected] Detroit 732-500-5050