Use an SQL statement to retrieve records from the m to n records -- retrieve records from the Table from the m to the n records: (NotIn Version) SELECTTOPn-m + 1 * FROMTableWHERE (idNOTIN (SELECTTOPm-1idFROMTable) -- extracts the m to n records (Exists version) from the TABLE SELECT
Use an SQL statement to retrieve records from the m to n records -- retrieve records from the Table from the m to the n records: (Not In version) select top n-M-1 + 1 * FROM Table WHERE
Retrieve records from the MTH to nth records using an SQL statement
-- Retrieve the records from the Table from entry m to entry n: (Not In version) select top n-m + 1 * FROM Table WHERE (id not in (select top S-1 id FROM Table) -- extracts records FROM the TABLE Table (Exists Version) select top n-m + 1 * from table as a WHERE Not Exists (Select * From (Select Top m-1 * From TABLE order by id) B Where B. id =. id) Order by id -- m is the superscript, and n is the subscript. For example, extract 8th to 12 records, m = 8, n = 12, and Table is the Table name, temp is the temporary Table Select Top n-m + 1 * From Table Where Id> (Select Max (Id) From (Select Top M-1 Id From Table Order By Id Asc) Temp) order By Id Asc -- find the m to n records in ascending Order, the more clumsy way is to Select * From (Select Top n-m + 1 * From (Select Top n * From table name Order By id Desc) t1 Order By id) t2 Order By id