SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

To fetch the immediate previous and next row

By Navaneeth Madhusoodanan,

Consider an employee table containing name and age of the employees. Write a script to retrieve the row which contain the details of the employee whose age is 50 and also retrieve the immediate next and previous rows

Total article views: 207 | Views in the last 30 days: 2
Related Articles

sql query need Help about Absent Employee

Query about absent employee


Employee Slurping

This editorial was originally published on Oct 21, 2006. It is being re-run as Steve is out at SQL i...


Employee Retention

A SQL Server DBA seems to be a stable job and many of us stick with the same job for an above averag...


Employee job mapping

Soln required for employee and job mapping query


Employee or 1099?

My friend Wes Dumey does a lot of work in the business intelligence sector as a contract employee an...