SQL Server 2012

External Article

Lead and Lag Functions in SQL Server 2012

  • Article

Arshad Ali discusses how to use CTE and the ranking function to access or query data from previous or subsequent rows. He also shows you how to leverage the LEAD and LAG analytics functions to achieve the same result without writing a self-join query using CTE and ranking function

2014-12-10

8,382 reads

Blogs

New Job -> Week 2 -> Creating a Checklist

By

This is part of a series of new job blog posts. You can find...

SQL Server 2022 Administration Inside Out

By

SQL Server 2022 Administration Inside Out is now available for pre-order from Microsoft Press. This...

WIT/DEI Mental Health and Wellness Day Challenge to Present

By

Back in December 2019, I started presenting my session on mental health with lots...

Read the latest Blogs

Forums

Managed Instance Link and SQL Server 2022

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Managed Instance Link and SQL...

Passing parameters to query without TVFs

By seanachim@hotmail.com

Comments posted to this topic are about the item Passing parameters to query without...

Capturing Data Changes

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Capturing Data Changes

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers