server| Paging
Select ThreadID from
(
Select ThreadID, Row_number () over (order by stickydate) as Pos from Cs_threads
) as T
where T.pos > 100000 and T.pos < 100030
===========================================
If the table inside the Cs_threads data volume, for example, hundreds of millions of records, then this method should be problematic
Because, select ThreadID from
(
Select ThreadID, Row_number () over (order by stickydate) as Pos from Cs_threads
) as T
where T.pos > 100000 and T.pos < 100030
This statement takes the select ThreadID, Row_number () over (the order by Stickydate) as the Pos from cs_threads it all out, and then pages out of the SQL, not tested on the SQL2005 Because this is not a good way to write on Oracle, as Oracle writes better: SELECT ThreadID from
(
Select ThreadID, Row_number () over (order by stickydate) as Pos from Cs_threads a where a.pos<100030
) as T
where T.pos > 100000