NTH_VALUE()
The Nth value starting from the first or the last row of the current frame
The same as type as expr
NTH_VALUE ( <expr>, <offset> )
[FROM {FIRST | LAST}]
OVER <window_name_or_spec>
| Argument | Description |
|---|---|
expr |
Expression.May contain a table column, constant, variable, expression, scalar function.Aggregate functions are not allowed as an expression. |
offset |
The offset in rows from the start ( |
The NTH_VALUE function returns the Nth value starting from the first (FROM FIRST) or the last (FROM LAST) row of the current frame, see also note on frame for navigational functions.Offset 1 with FROM FIRST is equivalent to FIRST_VALUE, and offset 1 with FROM LAST is equivalent to LAST_VALUE.