@StartIndex为当前页起始序号,@EndIndex为当前页结束记录序号,可以直接作为参数输入,也可以通过输入PageSize和PageIndex计算得出
<div class=”codetitle”><a style=”CURSOR: pointer” data=”42583″ class=”copybut” id=”copybut42583″ onclick=”doCopy(‘code42583’)”> 代码如下:<div class=”codebody” id=”code42583″>
select from
(
select ,row_number() over(order by OrderColumn) as orderindex from TableName
) as a
where a.orderindex between @StartIndex and @EndIndex