sql 分页
--如果RID必须唯一
declare @pagesize1 int;
set @pagesize1 = 10;
declare @pageindex1 int ;
set @pageindex1 = 1;
select top (@pagesize1) * from Reserves_Allocation_Ratio
where Rid not in(
select top (@pagesize1*(@pageindex1-1)) Rid from Reserves_Allocation_Ratio order by Rid
)
order by Rid
-- rownumber分页
declare @pagesize int;
set @pagesize = 10;
declare @pageindex int ;
set @pageindex = 1;
select top (@pagesize) * from
(
select ROW_NUMBER() over(order by Rid) rownumber,* from Reserves_Allocation_Ratio
) t
where rownumber >(@pagesize*(@pageindex-1))
order by Rid