bchx.net
当前位置:首页 >> DB2分页查询语句优化 >>

DB2分页查询语句优化

select * from (select 字段1,字段2,字段3,字段4,字段5,rownumber() over(order by 排序字段 asc ) as rowid from 表名 )as a where a.rowid >= startPage AND a.rowid

select * from ( select rownumber() over() as rownum, ### from ### where ### ) tempT where rownum > ### and rownum

DB2 只查询前10行 fetch first 10 rows only 例如: SELECT SALE_DATE, SUM(SALE_MONEY) AS SUM_MONEY FROM SALE_REPORT GROUP BY SALE_DATE ORDER BY SUM(SALE_MONEY) DESC fetch first 10 rows only; 如果要查询 11 - 20 使用 (fetch first 20...

db2 get db cfg for |grep -i "page size"

分号不需要,哈哈哈哈哈哈啊哈。

强烈建议你好好看看这篇博文: http://www.blogjava.net/kelefa/archive/2006/12/27/90246.aspx

网站首页 | 网站地图
All rights reserved Powered by www.bchx.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com