Skip to main content
Returns the value of an expression evaluated at the Nth row of the window frame. Returns NULL if the frame contains fewer than N rows. For more information on usage, please refer to Window Functions.

Syntax

Parameters

Return Type

Same as the input type of <expression>.

Remarks

  • <n> must be greater than or equal to 1. Passing 0 or a negative value raises an error.
  • Returns NULL when N exceeds the number of rows in the window frame.
  • This function respects NULL values, and results will be ordered with default null ordering NULLS LAST unless otherwise specified in the ORDER BY clause.

Example

The following example returns the second-lowest maxpoints value within each leveltype, repeated for every row in that group:

Rows: 10Execution time: 11.07ms