Earlier I wrote a series on SQL
Server Analytic Functions of SQL
Server 2012. During the series to keep the learning maximum and having fun, we had few puzzles. One of the puzzle was simulating LEAD() and LAG() without using SQL
Server 2012 Analytic Function.
Please read the puzzle here first before reading the solution : Write T-SQL Self Join
…