LEAD
LEAD provides access to more than one row of a table at the same time without a self-join. Given a series of rows returned from a query and a position of the cursor, LEAD provides access to a row at a given physical offset beyond that position.
Syntax
LEAD (expression [, offset_expression [, default_expression ] ] ) [IGNORE NULLS] OVER ( [ PARTITION BY expression [, ...] ]
ORDER BY expression [ ASC | DESC ] [ NULLS { FIRST | LAST } [, ...] )
Remarks
|
•
|
IGNORE NULLS and PARTITION BY are optional. |
|
•
|
The window clause is not allowed. |