Click here to Skip to main content
15,888,521 members
Articles / Database Development / SQL Server

How to fetch data from the previous or next rows in the resultset

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
31 Aug 2014CPOL1 min read 28.8K   11  
This tip demonstrates the use of LAG and LEAD functions in SQL Server.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Europe Europe
Biography provided

Comments and Discussions