Home > Database > Mysql Tutorial > SQL2005 大数据量检索的分页

SQL2005 大数据量检索的分页

WBOY
Release: 2016-06-07 18:04:29
Original
897 people have browsed it

仅列出实例SQL,其他的请大家自己完成吧

@StartIndex为当前页起始序号,@EndIndex为当前页结束记录序号,可以直接作为参数输入,也可以通过输入PageSize和PageIndex计算得出
代码如下:
select * from
(
select *,row_number() over(order by OrderColumn) as orderindex from TableName
) as a
where a.orderindex between @StartIndex and @EndIndex
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template