当前位置: 技术问答>java相关
Oracle排序分页的SQL语句问题
来源: 互联网 发布时间:2015-08-11
本文导语: 我在用Oracle数据库的时候需要分页显示,最后生成的SQL语句(第二页): select * from (select TableA.*,rownum as rowno from TableA order by CreateTime desc) where rowno>='11' and rowno 80 AND NUMROW 80 AND NUMROW select * from ...
我在用Oracle数据库的时候需要分页显示,最后生成的SQL语句(第二页):
select * from (select TableA.*,rownum as rowno from TableA order by CreateTime desc) where rowno>='11' and rowno 80 AND
NUMROW 80 AND NUMROW select * from (select rownum row_id ,month,sell
2 from (select month,sell from sale group by month,sell))
3 where row_id between 5 and 9;
如何用rownum实现大于、小于逻辑?(返回rownum在4—10之间的数据)(minus操作,速度会受影响)
SQL> select rownum,month,sell from sale where rownum
select * from (select TableA.*,rownum as rowno from TableA order by CreateTime desc) where rowno>='11' and rowno 80 AND
NUMROW 80 AND NUMROW select * from (select rownum row_id ,month,sell
2 from (select month,sell from sale group by month,sell))
3 where row_id between 5 and 9;
如何用rownum实现大于、小于逻辑?(返回rownum在4—10之间的数据)(minus操作,速度会受影响)
SQL> select rownum,month,sell from sale where rownum