Returns the last value in the window frame.
Syntax
LAST_VALUE(expr) OVER (w)Example
Enter values below to update the example in real time.
employee_id→salary→hire_date→last_hired_salary→employees→SELECT employee_id, salary,
LAST_VALUE(salary) OVER (
ORDER BY hire_date
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) AS last_hired_salary
FROM employees;