SELECT hire_date.emp_no, (up_to_date.salary-hire_date.salary) AS growth
FROM (SELECT e.emp_no, s.salary
FROM employees e JOIN salaries s
ON e.emp_no = s.emp_no
AND e.hire_date = s.from_date) AS hire_date
JOIN (SELECT e.emp_no, s.salary
FROM employees e JOIN salaries s
ON e.emp_no = s.emp_no
WHERE s.to_date = '9999-01-01') AS up_to_date
ON hire_date.emp_no = up_to_date.emp_no
ORDER By growth