select s.emp_no, s.salary, s.from_date, s.to_date, d.dept_no from salaries as s left join dept_manager as d on s.emp_no=d.emp_no where d.dept_no is not null order by s.emp_no