LAST_VALUE

<< Click to Display Table of Contents >>

Navigation:  Streaming SQL Reference Guide > Basic Building Blocks > Functions > Built-in Functions >

LAST_VALUE

Previous pageReturn to chapter overviewNext page

LAST_VALUE returns the evaluation of the <value expression> from the last row that qualifies for the aggregate.

Syntax

LAST_VALUE ( <value-expression> )  OVER <window-specification>

 

Null treatment option

Effect

LAST_VALUE(x) IGNORE NULLS OVER <window-specification>

Returns last non null value of x in <window-specification>

LAST_VALUE(x) RESPECT NULLS OVER <window-specification>

Returns last value, including null of x in <window-specification>

LAST_VALUE(x) OVER <window-specification>

Returns last value, including null of x in <window-specification>

See the topic WINDOW clause of the SELECT statement for more details on defining windows.