LAST_VALUE

Returns the last value of the window.

ParameterTypeDescription
value
any
The name of the column to evaluate
Returns: any

Example

query:

SELECT account, create_date, order_value, LAST_VALUE(order_value) OVER (PARTITION BY account ORDER BY create_date ROWS between unbounded preceding and unbounded following)
  FROM jun_2017_orders

result:

account create_date order_value last_value
Betasoloin 2017-06-03 5100 1036
Betasoloin 2017-06-04 2887 1036
Betasoloin 2017-06-06 4492 1036
Betasoloin 2017-06-09 5182 1036
Betasoloin 2017-06-24 1036 1036
Gekko & Co 2017-06-02 5304 5622
Gekko & Co 2017-06-11 1075 5622
Gekko & Co 2017-06-12 1062 5622
Gekko & Co 2017-06-14 497 5622
Gekko & Co 2017-06-19 67 5622
Gekko & Co 2017-06-25 5031 5622
Gekko & Co 2017-06-26 5622 5622
Plexzap 2017-06-11 3850 564