Sql Query To Use a ' SELECT ' statement with IN Clause


The IN Statement is used mainly in a subquery or taking value from the array.

Suppose if we want data from the other table using a subquery then use 1st query.

If we want data from the array then use 2nd query.

Enter - Select * from table_name;
SQL Query
SELECT 'Select statement using IN Clause with subquery';/*message*/ SELECT * FROM employees WHERE department_id IN (SELECT department_id FROM departments WHERE location_id!=1700); SELECT ' ';/*space for better understanding*/ SELECT 'Select statement using IN Clause with array';/*message*/ SELECT * FROM employees WHERE department_id IN (40,50,60);
Output