WITH temp_table AS ( SELECT emp_no, salary, to_date, FIRST_VALUE(salary) OVER (PARTITION BY emp_no ORDER BY to_date DESC) AS fv, FIRST_VALUE(salary) OVER (PARTITION BY emp_no ORDER BY to_date) AS lv FROM salaries ) SELECT emp_no,(fv-lv) AS growth FROM temp_table WHERE to_date=&q...