I want to find the last value of y over an ordered partition using a query like this:
y
SELECT x, LAST_VALUE(y) OVER (PARTITION BY x ORDER BY y AS
Other option you have is to change the query order by to desc
SELECT x, LAST_VALUE(y) OVER (PARTITION BY x ORDER BY y ASC) FROM table order by x desc
but the you will get the last value only for the first row