The LAG function has the ability to fetch data from a previous row, while LEAD fetches data from a subsequent row.

Sources:

https://www.mssqltips.com/sqlservertutorial/9127/sql-server-window-functions-lead-and-lag/
Last modified: January 20, 2020

Author

Comments

Write a Reply or Comment