美文网首页
oracle分页

oracle分页

作者: 韩绝交 | 来源:发表于2018-05-07 17:05 被阅读0次
    //第一种
    SELECT * FROM 
    (
    SELECT A.*, ROWNUM RN 
    FROM (SELECT * FROM TABLE_NAME) A 
    WHERE ROWNUM <= 40
    )
    WHERE RN >= 21​
    
    //第二种
    SELECT * FROM 
    (
    SELECT A.*, ROWNUM RN 
    FROM (SELECT * FROM TABLE_NAME) A 
    )
    WHERE RN BETWEEN 21 AND 40
    

    对比结果:


    相关文章

      网友评论

          本文标题:oracle分页

          本文链接:https://www.haomeiwen.com/subject/nlzmrftx.html