SQL SERVER – Introduction to LEAD and LAG – Analytic Functions Introduced in SQL Server 2012

SQL Server 2012 introduces new analytical function LEAD() and LAG(). These functions accesses data from a subsequent row (for lead) and previous row (for lag) in the same result set without the use of a self-join . It will be very difficult to explain this in words so I will attempt small example to explain … Continue reading SQL SERVER – Introduction to LEAD and LAG – Analytic Functions Introduced in SQL Server 2012