2013/5/7 11:23
以前一直用的oracle,最近因为项目需要,学习了一下db2相关的东西,下面记录一下一个常用的分页语法:
select * from (select 字段1,字段2,字段3, rownumber() over (order by 字段4 asc )
as rowid from 表名 )as a
where a.rowid >= startNum and a.rowid <endNum;
demo:
select * from (select customercode, customername, creditcode, rownumber() over (order by statisticdate asc )
as rowid from tr5_b1_p1 )as a
where a.rowid >= 10 and a.rowid <20;