你可以用select * from tablename where rownum between 10 and 20;

解决方案 »

  1.   

    select * from (select rownum id,a.* from tablename a order by ...) b
    where b.id between 10 and 20;
      

  2.   

    rownum!select *
    from table
    where rownum
    order by field.
      

  3.   

    to  snowy_howe(天下有雪) 
    这种方法是不是最优的办法?
    这样实际上是搜索出实际的条数(比如5万条),再从中取了几条。速度和搜索五万条记录一样。
      

  4.   

    to : buddyxue(薛训明) 你可以用select * from tablename where rownum between 10 and 20;单纯的rownum似乎是不行的,你可以试试.
      

  5.   

    select * from (select rownum id,tbname.* from tbname where rownum<=20) a
    where a.id>=10;
      

  6.   

    select * from (select rownum id,tbname.* from tbname where rownum<=20) a
    where a.id>=10;
      

  7.   

    这个问题,你看看这个,讨论的比较详细了:
    http://www.cnoug.org/bin/ut/threaded_show.cgi?tid=38&h=1&bpg=1&age=0
      

  8.   

    你可以分段统计,如根据表中某一字段id,然后累计所得结果
    select count(*) from tbname where id<100000select count(*) from tbname where id>=100000 and id<1000000
    .
    .
    .
    select count(*) from tbname where id>10000000
      

  9.   

    结贴,请看 tuidler() 推荐的:
    http://www.cnoug.org/bin/ut/threaded_show.cgi?tid=38&h=1&bpg=1&age=0