select * from (select rownum id,tb.* from tb) where id>n and id<n+10;

解决方案 »

  1.   

    select * from tablename where rownum<=n+10
    minus
    select * from tablename where rownum<n;
      

  2.   

    请问  zhaoyongzhu(zhaoyongzhu) 
    minus 是什么意思,chenqsbeast () 的意思是从 n 到 n+10 共 10 条记录
    但是我只查询出来 6 条。
    oracle 的 sql 语句中不知道有没有类似 mysql 的
     limit m, n 
    这样的记录集分页的语句
      

  3.   

    minus是集合运算中的-,这个方法真巧。
    两种方法的结果是一致的。
    不过我推荐 bzszp(SongZip)的做法,因为这种做法可以实现排序输出,如下:
    select * from (select rownum id,tb.* from tb order by ?) where id>n and id<n+10;
    而集合运算只能对最终结果集排序。
      

  4.   

    嗯! bzszp(SongZip) 的方法确实可以。