In SQL, do we always need to use UNBOUNDED FOLLOWING while using last_value function in analytical functions?
I saw this example where if we just used:
SELECT employee_id, salary, last_value(salary) over(order by salary ASC)
FROM employees;
This did not give the expected output which was supposed to give the employee with the highest salary.
Instead they had to use windowing:
SELECT employee_id, salary,
last_value(salary) over (
order by salary ASC ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
FROM employees;
So I was just wondering if while using last_value function, do we always need to use UNBOUNDED FOLLOWING?