I'm trying to select rows between specific row numbers (like 1 to 50 or 51 to 10 etc.).
Below is my table MatTk
schema and all of columns allow nulls:
tk_id [varchar(50)] | mat_id [varchar(50)] | ven_id [varchar(50)] | tk_rate [money]
1023 104 2212 120.11
This article Select subset of rows using Row_Number() suggests ORDER BY id
but I want to avoid it and show it in the natural order of the table data.
Also check this article SQL Server 2005 ROW_NUMBER() without ORDER BY which suggests inserting into a temp table but it's not an option since the MatTk
table has millions of rows.
Is there a way to query rows by row number without order by ID and without creating temp table?