V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
wbing
V2EX  ›  问与答

oracle 如何”更快的“返回指定行数之间的查询结果???

  •  
  •   wbing · 2016-05-10 21:21:20 +08:00 · 1730 次点击
    这是一个创建于 2914 天前的主题,其中的信息可能已经有所发展或是发生改变。
    现在只知道用 minus , 

    select ... where rownum < 50 minus select ... where rownum < 30  

    但貌似速度好慢,一亿多条数据的库,每次查 500 条数据出来都要几秒
    2 条回复    2016-05-11 14:12:48 +08:00
    wyj12501
        1
    wyj12501  
       2016-05-11 09:42:18 +08:00
    select *
    from (select rownum rn, a.*
    from (select * from XXX where YYY order by ZZZ) a
    where rownum < 50)
    where rn > 30;
    wbing
        2
    wbing  
    OP
       2016-05-11 14:12:48 +08:00
    @wyj12501 谢谢,不过越读到后面就变得超慢了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1146 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:45 · PVG 01:45 · LAX 10:45 · JFK 13:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.