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

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

  •  
  •   benson458 · 2016-05-10 21:21:20 +08:00 · 2187 次点击
    这是一个创建于 3463 天前的主题,其中的信息可能已经有所发展或是发生改变。
    现在只知道用 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;
    benson458
        2
    benson458  
    OP
       2016-05-11 14:12:48 +08:00
    @wyj12501 谢谢,不过越读到后面就变得超慢了
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3948 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 05:27 · PVG 13:27 · LAX 21:27 · JFK 00:27
    ♥ Do have faith in what you're doing.