SELECT emp.emp_no, manager.emp_no
FROM dept_emp emp, dept_manager manager
WHERE emp.emp_no != manager.emp_no
AND emp.dept_no = manager.dept_no
AND manager.to_date = '9999-01-01'
SELECT emp.emp_no, manager.emp_no
FROM dept_emp emp, dept_manager manager
WHERE emp.emp_no != manager.emp_no
AND emp.dept_no = manager.dept_no
AND manager.to_date = '9999-01-01'