Only this week, get the SQL Complete Track of 9 courses in a special prize of $330$89!
Introduction
FIRST_VALUE(), LAST_VALUE()
19. LAST_VALUE(x) – practice
Summary

## Instruction

The query worked fine this time. Here's one thing you should remember: while FIRST_VALUE() works well with the default window frame, LAST_VALUE() needs an explicit definition of the right window frame to actually make sense.

Of course, you can order by one column and return the other:

SELECT
Name,
Budget,
LAST_VALUE(Budget) OVER(ORDER BY OpenDate ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS MostRecentBudget
FROM Website;


Here we show the budget of the most recent website (not the biggest budget).

Show the statistics for WebsiteId = 1. For each row, show the Day, the number of impressions and the number of impressions on the day with the most users. Name the column LastImpressions.
Use LAST_VALUE(Impressions) and sort by the number of users.