PostgreSQL · Function
lead
lead returns a value from a later row in the current window partition. It defaults to looking one row ahead and returns NULL when that row does not exist.
Last updated
Syntax
lead ( value anycompatible [ , offset integer [ , default anycompatible ] ] ) → anycompatibleIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
lagfirst_valuelast_valuenth_valueOVERPARTITION BY