SQL Server 2012: Introduced LAG function, the best alternative of Self Join to compare Previous Row

In this post, I am going to demonstrate one of new LAG() function which is introduced by SQL Server 2012. Generally, we are using Self Join to perform row-level analysis by comparing Next and Previous rows. SQL Server 2012 has a LAG() function is used for accessing data from the Previous Row in the same … Continue reading SQL Server 2012: Introduced LAG function, the best alternative of Self Join to compare Previous Row