select * from a1 as A where
(select count(id) from a1 where id <= A.id)
between 6 and 10 order by idselect id from
(select top 5 * from
(select top 10 * from a1 order by id) as A
order by A.id desc) as B order by B.id asc
(select count(id) from a1 where id <= A.id)
between 6 and 10 order by idselect id from
(select top 5 * from
(select top 10 * from a1 order by id) as A
order by A.id desc) as B order by B.id asc
set @SQLStr='SELECT Top '+cast(@每页大小 as varchar)+' * FROM 表 WHERE 主键列 NOT IN (SELECT TOP '+cast(@每页大小*@第几页 as varchar)+' 主键列 from 表 )'
exec(@SQLStr)
select * from #temp where ID_Num between 10 and 20
我的意思是我在第一个Recordset中查了一定数目项后
第二个Recordset接着第一个Recorset后面查。如第一个查了N项, 第二个只能查N项以后的