美文网首页
Oracle分页查询rownum与row_number() o

Oracle分页查询rownum与row_number() o

作者: 如果不是废物谁又愿混吃等死 | 来源:发表于2019-06-12 15:38 被阅读0次

    row_number() over()
    ...

    select *
    from (select *
          from (select b.*, row_number() over(order by bookid) as rownumber
                  from (select * from book) b)
         where rownumber > 0)
     where rownum <= 8;
    

    ...

    ...

    select *
    from (select *
          from (select b.*, row_number() over(order by bookId) as rownumber
                  from (select * from book) b))
     where rownumber >= 0  and  rownumber <= 10;
    

    ...

    rownum

    ...

     select *
      from (select b.*, rownum as rn
          from (select * from book order by bookId) b
         where rownum <= 8)
      where rn > 0;
    

    ...

    ...

    select *
    from (select b.*, rownum as rn from (select * from book order by bookId) b)
     where rn >= 0 and rn <= 10;
    

    ...

    相关文章

      网友评论

          本文标题:Oracle分页查询rownum与row_number() o

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