LEAD / LAG

[Cloud release: 2026.06.17]
[On-prem release: Expected 2026 Q3]
[On-prem build: tbd]
 

Added support for LEAD and LAG functions e.g.


select customerid, freight, lead(freight,1) over (partition by customerid order by freight)
as lead2 from orders order by customerid,freight


It takes 2 parameters and the second parameter has to be a positive integer less than 2^31.

If a second parameter is not specified it will default to one.

Does not support IGNORE NULLS | RESPECT NULLS syntax. Currently implementation uses RESPECT NULL behavior.

Does not support specifying a third parameter to specify a default value for nulls.

LEAD returns values N rows after current record according to the partition and order by clause.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.