客户专线:400-641-8864 / 153-2383-7083 | 在线QQ:987837344
首页 易当家ERP 鼎捷ERP 行业方案 实施方法 联系我们  
 

分页算法之俄罗斯存储过程


declare @PageSize int --页面大小,如每页存储20条记录

    ,@PageIndex int --当前页码,从1开始

set @PageSize=200

set @PageIndex=3

declare @Indextable table(

    aid int identity(1,1)

    ,BillNo nvarchar(20)

) --定义表变量

declare @PageLowerBound int --定义此页的底码

declare @PageUpperBound int --定义此页的顶码

set @PageLowerBound=(@PageIndex-1)*@PageSize

set @PageUpperBound=@PageLowerBound+@PageSize

set rowcount @PageUpperBound

insert into @Indextable(BillNo)

    select BillNo from PD01_Product

        --where fariqi >dateadd(day,-365,getdate())

        order by BillNo

select BillNo,ProductNo,ProductName,Specification,Unit,Memo

    From PD01_Product

    where State<100 and BillNo in (select BillNo from @Indextable where aid>@PageLowerBound and aid<=@PageUpperBound)




猜您喜欢:     易当家E9ERP     易当家E8ERP     微信公众号开发

ERP,ERP系统,ERP软件
ERP软件 | 鼎捷软件 | 神州数码 |
Copyright© 2008-2016 深圳市易当家软件开发有限公司. All Rights Reserved. 粤ICP备14043283号