SQL IN
The most common use for the IN
command is comparing a column to multiple possible values.
-- Works in PostgreSQL, MySQL, SQL Server, and Oracle.
SELECT
*
FROM
tenants
WHERE
id IN (1, 4);
tenants
table
id | name |
---|---|
1 | Albert |
2 | Marie |
3 | Jose |
4 | Terrell |
Query results
id | name |
---|---|
1 | Albert |
4 | Terrell |