存储过程分页
来源:互联网 发布:cacti的linux镜像 编辑:程序博客网 时间:2024/06/06 13:14
create procedure queryTabel
(
@PageIndex int,
@PageSize int
)
as
begin
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=@PageIndex*@PageSize
set @PageUpperBound=@PageLowerBound+@PageSize-1
select * from (select t.*,ROW_NUMBER()Over(order by t.id desc) as rowId from [dbo].[T_UserName] t) t1 where t1.rowId>@PageLowerBound and t1.rowId<=@PageUpperBound
end
(
@PageIndex int,
@PageSize int
)
as
begin
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=@PageIndex*@PageSize
set @PageUpperBound=@PageLowerBound+@PageSize-1
select * from (select t.*,ROW_NUMBER()Over(order by t.id desc) as rowId from [dbo].[T_UserName] t) t1 where t1.rowId>@PageLowerBound and t1.rowId<=@PageUpperBound
end
exec queryTabel 1,10
简单的说row_number()从1开始,为每一条分组记录返回一个数字,这里的ROW_NUMBER() OVER (ORDER BY xlh DESC) 是先把xlh列降序,再为降序以后的没条xlh记录返回一个序号。
- orcale分页 存储过程分页
- 一个分页存储过程
- 一个分页存储过程
- 存储过程分页代码
- 分页存储过程
- 数据库分页存储过程
- 分页存储过程
- 一个分页存储过程
- 分页 SQLServer存储过程
- 分页 SQLServer存储过程
- 存储过程分页
- SqlServer分页存储过程
- 分页的存储过程
- 通用分页存储过程
- sql 存储过程分页
- 分页存储过程
- 分页存储过程2
- 分页的存储过程
- USB启动
- putty自动登录Ubuntu服务器设置
- 访问aspx页面时提示“无法找到该页”的解决方法
- IOS 消息推送---服务端.p12证书的生成
- codeforces 231 C To Add or Not to Add 贪心
- 存储过程分页
- 带标签的 break 和 continue (Java)
- SceneControl+AE+鼠标滚轮缩放
- 解决singleton Bean依赖prototype Bean不能实时更新的问题
- 背景减除法综述
- 关于SIGPIPE导致的程序退出
- IOS消息推送------推送证书的安装与调试
- 使用BeanUtils方法拷贝不上问题
- iframe使用说明