当前位置:数据库 > DB2 >>

DB2的分页查询语句


DB2的分页查询语句
 
利用rownumber() over()这种方式实现,例如
 
Java代码  
select * from (select a.*,rownumber() over() as rowid from (select * from tbl_net_order) a) tmp where tmp.rowid >=#{startIndex} and -www.zzzyk.com- tmp.rowid <= #{endIndex};  
 
根据计算出来的行数,由外部传来起始行和结束行进行分页。
 

 
 
摘自 老田的博客
Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,