Original: The method of extracting article m to nth record with an SQL statement
--Take the record of article M to nth from table tables: (not in version)
SELECT TOPN-m+1 *
from Table
WHERE(ID not inch (SELECT TOPm-1ID from Table ))
--Remove the M-to-N records from table tables (exists version)
SELECT TOPN-m+1 * from TABLE asaWHERE not Exists
(Select * from (Select Topm-1 * from TABLE Order byID) bWhereb.id=a.id)
Order byID
--m is superscript, n is subscript, for example, take out 8th to 12th record, m=8,n=12,table is table name, TEMP is temp table
Select TopN-m+1 * from Table
WhereId>(Select Max(Id) from
(Select Topm-1Id from Table Order byIdASC) Temp)
Order byIdASC
--The more awkward way to figure out the ascending m to nth record is
Select * from
(Select TopN-m+1 * from (Select TopN* fromTable nameOrder byIDDesc) T1Order byID) T2
Order byID
Method of extracting the article m to nth record with an SQL statement