我爱Aspx >> C#.Net >> 分页实现方法的性能比较我们先给出几种主要的分页方法和核心语句,然后直接给出结论,有兴趣的读者可以看看后面的数据
几种常用存储过程分页方法
TopN方法
select Top(@PageSize) from TableName where ID Not IN
(Select Top ((@PageIndex-1)*@PageSize) ID from Table Name where .... order by ... )
where .... order by ...
临时表
declare @indextable table(id int identity(1,1),nid int,PostUserName nvarchar(50))
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize--下限
set @PageUpperBound=@PageLowerBound+@pagesize--上限
set rowcount @PageUpperBound
insert into @indextable(nid,PostUserName) select ReplyID,PostUserName from TableName order by ......
select * from TableName p,@indextable t where p.ID=t.nid
and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
CTE--2005新语法,类似临时表,但是生命周期稍微不同,这里只是他的一个运用
Ҷƪл˵?
Photoshop画笔为照片添加雪粉边框[07-30]
Photoshop辅助线和标尺的使用技巧[07-30]
Word 2007表格及表格项的复制与移..[07-30]
解决卡巴斯基6.0自动断开连接重新..[07-30]
Discuz!新版本换新颜—全新模板抢..[07-30]
快速掌握MySQL数据库中SELECT语句[07-30]
QQ2007 7.0 Beta3发布 表情功能有..[07-30]
用javascript实现select的美化[07-30]
网页中各度量单位的比较[07-30]
用javascript 转换外部链接样式[07-30]