sql server 的存储分页语句

create  proc  up_GetPageData

@pi  int --页码 

@ps  int    --页容量

as

begin

select * from (

select ROW_NUMBER() over(order by id) as RNum,*from table

) as temp

where  RNum>(@pi-1)*@ps and RNum<=@pi*@ps

end

 

再来执行这一条语句exec  up_GetPageData 1,4

posted on 2012-07-06 23:18  仙梦之飘  阅读(112)  评论(0编辑  收藏  举报