Here the example describes the ROW_NUMBER() approach to select a set or rows using virtual rownumber
SELECT ID, Row FROM
( SELECT ID, (ROW_NUMBER() OVER (ORDER BY ID))
AS Row FROM TableName) Rows
WHERE Row BETWEEN 10 and 20
The other option is using of CTE
No comments:
Post a Comment