Last active
August 29, 2015 14:10
-
-
Save sygour/93bd129b213a73602f41 to your computer and use it in GitHub Desktop.
Useful SQL request
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
-- select the nth row of a table | |
-- from http://stackoverflow.com/questions/16568/how-to-select-the-nth-row-in-a-sql-database-table | |
SELECT * FROM ( | |
SELECT | |
ROW_NUMBER() OVER (ORDER BY key ASC) AS rownumber, | |
columns | |
FROM tablename | |
WHERE condition | |
) AS foo | |
WHERE rownumber = n | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment