with tmp(dep_no,e_no) as( select dept_emp.dept_no, e.emp_no from employees as e, dept_emp where e.emp_no not in ( select dm.emp_no from dept_manager as dm ) and dept_emp.emp_no = e.emp_no ) select dep_no as dept_no, e_no as emp_no, salary from ...