oracle分页查询问题

影非弦 发布于 2015/07/02 21:25
阅读 157
收藏 0

在oracle中查询一个表,该表共有576条记录,分页查询,每页50条记录,查询最后一页,也就是12页,SQL语句如下:SELECT * FROM (SELECT ROWNUM AS RN,T.* FROM (SELECT * FROM UPPER_DATA) T WHERE ROWNUM<=600) WHERE RN >550

最后一页应该是26条记录的,但是查询结果却显示了50条,求解!

加载中
0
alexgaoyh
alexgaoyh
select COLUMN from ( select row_.COLUMN , rownum rownum_ from TABLE  row_ ) where rownum_ > 550 and rownum_ <= 600
0
IdleMan
IdleMan
SELECT *
  FROM (SELECT ROWNUM AS RN, T.*
          FROM (SELECT * FROM UPPER_DATA WHERE ROWNUM <= 600) T)
 WHERE RN > 550

order 和 rownum<=不要用在同一级



返回顶部
顶部