↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Functions

nth_value

Returns value evaluated at the row that is the n'th row of the window frame (counting from 1); returns NULL if there is no such row.

English manual coverage begins with PostgreSQL 7.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

group
window
group label
Window Functions
lang
en
layout
table-new
pages
functions-window.html
prose only
false

Definition PG 18

Returns value evaluated at the row that is the n'th row of the window frame (counting from 1); returns NULL if there is no such row.

Signatures and overloads

nth_value ( value anyelement, n integer ) → anyelement → anyelement
Returns value evaluated at the row that is the n'th row of the window frame (counting from 1); returns NULL if there is no such row.

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:2fd6b4a3b2aa705fa7cb16043400e8b175afc4bd8620f3e04f507703719af82c

Text language: en · wiki-repair-20261023:2fd6b4a3b2aa705fa7cb16043400e8b175afc4bd8620f3e04f507703719af82c