Aggregate. Returns the last value from an ordered set of values. LAST_VALUE() is an alias for the LAST() function in the Sybase CEP compiler.
LAST_VALUE( expression )
expression | The expression on which to determine the last value in an ordered set. |
LAST_VALUE returns the last value in an ordered set of values. If the last value in the set is null, then the function returns NULL unless you specify IGNORE NULLS. If you specify IGNORE NULLS, then LAST_VALUE returns the last non-null value in the set, or NULL if all values are null.
You cannot use LAST_VALUE or any other analytic function as an expression. That is, you cannot nest analytic functions, but you can use other built-in function expressions for expression.
Sybase extension.
INSERT INTO OutOpenCloseMinMax2 SELECT LAST_VALUE(Price) as OpenPrice, FIRST_VALUE(Price IGNORE NULLS) as OpenPrice2, GETTIMESTAMP(LAST_VALUE(MyWindow)) as t1 FROM MyWindow