Taking a Peek at Another Row

Kathi Kellenberger, Clayton Groom · Apress eBooks · 2015

Along with accumulating window aggregates, Microsoft added eight new window functions with SQL Server 2012. Four of the functions, which I'll call offset functions in this book, are my favorite T-SQL functions, and they are LAG , LEAD , FIRST_VALUE , and LAST_VALUE . These functions let you include any columns from other rows in your results without a self-join and with fantastic performance. These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Read the paper · More papers on PaperTik