Created
January 27, 2016 08:12
-
-
Save dnasca/67b0ffb6c806d9a0e348 to your computer and use it in GitHub Desktop.
query paging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- returning the first 25 rows | |
SELECT | |
e.FirstName, | |
e.LastName, | |
e.AddressLine1 | |
FROM | |
HumanResources.vEmployee AS e | |
ORDER BY | |
e.LastNAme, e.FirstName | |
OFFSET 0 ROWS | |
FETCH NEXT 25 ROWS ONLY; | |
-- paging through the next 25 rows | |
SELECT | |
e.FirstName, | |
e.LastName, | |
e.AddressLine1 | |
FROM | |
HumanResources.vEmployee AS e | |
ORDER BY | |
e.LastNAme, e.FirstName | |
OFFSET 24 ROWS | |
FETCH NEXT 25 ROWS ONLY; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment