If you want to get rows base on some range from your database table, then use the following query block for the same:
WITH NumberedMyTable AS ( SELECT ROW_NUMBER() OVER (ORDER BY g_regno) AS RowNumber, * FROM myTable ) SELECT * FROM NumberedMyTable WHERE RowNumber BETWEEN @FromNum AND @ToNum
Where @FromNum is starting range and @ToNum is the ending number. For example if you want to get row number 51 to 100, Final query will be:
Where @FromNum is starting range and @ToNum is the ending number. For example if you want to get row number 51 to 100, Final query will be:
SELECT * FROM NumberedMyTable WHERE RowNumber BETWEEN 51 AND 100