NTH_VALUE

NTH_VALUE returns the expression value of the nth row in the window defined by the window clause. The returned value has the data type of the expression.

Syntax

NTH_VALUE (expression, nth_row) [FROM FIRST | FROM LAST] [IGNORE NULLS] OVER (window_clause)

Remarks

FROM LAST is optional.
If FROM LAST is not specified, FROM FIRST is the default.