Labels

Wednesday, April 3, 2013

Pagination Support

-- Support for Pagination using ORDER BY along with OFFSET and FETCH NEXT

-- The new pagination support allows you to write queries that can return rows from specific position of the result set.

--For example: the following query returns rows 20 to 30 from the result set.

USE [AdventureWorks2012]
GO

SELECT  *  FROM [HumanResources].[Employee]
ORDER BY HireDate   
OFFSET 20 ROWS
FETCH NEXT 10 ROWS ONLY;


SELECT   *  FROM [HumanResources].[Employee]
ORDER BY HireDate

No comments:

Post a Comment