分页存储过程2000
浏览:30日期:2023-06-29
CREATE procedure GetUsers(@pagesize int,@pageindex int,@docount bit)asset nocount onif(@docount=1)select count(userId) from Userselsebegindeclare @indextable table(id int identity(1,1),nid int)declare @PageLowerBound intdeclare @PageUpperBound intset @PageLowerBound=(@pageindex-1)*@pagesizeset @PageUpperBound=@PageLowerBound+@pagesizeset rowcount @PageUpperBoundinsert into @indextable(nid) select userId from Users order by userName descselect O.* from Users O,@indextable t where O.userId=t.nidand t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.idendset nocount offGO
相关文章:
热门推荐
- Apache中通过配置http.conf绑定多个域名以及二级域名的方法
- 1.页面中标题替换方法,在SQL中取数据时
- 2.ASP 3.0高级编程(一)
- 3.Sybase邹作基获选2007中国软件十大领军人物
- 4.FreeBSD下安装MySQL+Apache+PHP新手指南
- 5.戏说编程语言之如何使用各种编程语言杀死一条龙
- 6.当面试官问我ArrayList和LinkedList哪个更占空间时,我是这么答的(面试官必问)
- 7.Solaris如何增加用户?(groupadd,useradd)
- 8.Yii2.0 rules验证规则大全
- 9.SMTP协议-PHP的邮件发送程序例子
- 10.什么是全栈开发者——全栈工程师的定义、具备的技能以及优势