RSS Feed

SQL IN

Example 1 of SQL IN

You can use the IN function as below:

SELECT *
FROM EMP
WHERE EMP_ID in (10000, 10001, 10003, 10005);

This SQL statement would return all EMPLOYEES where the EMP_ID is either 10000, 10001, 10003, or 10005.

Example 2 of SQL IN

SELECT *
FROM suppliers
WHERE supplier_name in ('Apple', 'HP', 'Microsoft');

Above query will return all rows where the supplier_name is either Apple, HP, or Microsoft.