select 
    t1.*,
    t2.dept_no 
from salaries  t1 
  inner join dept_manager t2 on t1.emp_no = t2.emp_no
     where t1.to_date ='9999-01-01' and t2.to_date ='9999-01-01'