programming-examples/sql/SubqueriesHRDatabase/Write a query to display all the information of the employees who does not work in those departments where some employees works.sql

9 lines
348 B
MySQL
Raw Permalink Normal View History

2019-11-18 14:05:53 +01:00
/*Write a query to display all the information of the employees who does not work in those departments where some employees works whose id within the range 100 and 200.
*/
SELECT *
FROM employees
WHERE department_id NOT IN
(SELECT department_id
FROM departments
WHERE manager_id BETWEEN 100 AND 200);