用row_nuber 分页的存储过程

create PROCEDURE p_fenYe
@pageIndex int ,
@pageSize int 

as 
begin 

select *from 
( select ROW_NUMBER() over(order by cityid) as rowNuber,* from CF_City)as temp 
where rowNuber between ((@pageIndex-1)*@pageSize)+1 and @pageIndex*@pageSize

end 


exec p_fenYe 1,10

 

posted @ 2015-04-09 11:19  VisibleIsFalse  阅读(145)  评论(0编辑  收藏  举报