DB2分页


  1. 使用rownumber() over()函数产生序列,再where条件限定条数。
select * from (select rownumber() over() as tbid, a.* from SAPHEC.ZBMT301 a) as b where b.tbid<=10;
  1. 查询第10条至第15条的数据
select * from (select rownumber() over() as tbid, a.* from SAPHEC.ZBMT301 a) as b where b.tbid between 10 and 15;
  1. fetch first 10 rows onl取10条数据
SELECT * FROM SAPHEC.ZBMT301 fetch first 10 rows only;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM