 |
SQL Select Next Row and SQL Select Previous Row with Current Row using T-SQL CTE
WITH CTE as ( SELECT RN = ROW_NUMBER() OVER (ORDER BY EmployeeID), * FROM HumanResources.Employee) SELECT [Previous Row].*, [Current Row].*, [Next Row].* FROM CTE [Current Row] LEFT JOIN CTE [Previous Row] ON
www.kodyaz.com |
 |