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 |