对一个上千万条数据的表进行全检索,由于数据太多,打算每次检索一万件,然后循环,
也就是说,先检索1-10000条,第二次检索第10001-20000件。有什么好的方法啊。
不要使用字段名。因为有许多不同的表要多这样的操作。谢谢了。

解决方案 »

  1.   

    select * from a where rownum<=10000
    select * from a where rownum > 10000 and ruwnum < 20000
      

  2.   

    select * from a where rownum<=10000
    select * from a where rownum > 10000 and ruwnum <= 20000
      

  3.   

    带rownum的检索语句不可以使用〉
    也就是说rownum>10000这个条件好象不可以使用吧。
      

  4.   

    select * from a where rownum > 10000 and ruwnum < 20000这个语句得到的结果是空
      

  5.   

    可以这样写,但是效率很低:
    select * from a where rownum <20000 and rownum not in (select rownum from a where rownum < 10000)上面几位兄弟写的SQL ORALCE是不支持的。
    最好是先数据取出来,然后在程序里面控制打开的数量。
      

  6.   

    select * from (select * from tbname where rownum<=20000)
    where rownum>10000;
      

  7.   

    bzszp(SongZip)的方法好像也不可以。(select * from 表名 where rownum <=2000)
    minus
    (select * from 表名 where rownum <1001)
    这种方法倒是可以的。
      

  8.   

    selec * from (select rownum rm,a.* from table_name a) where rm<=20 and rm>=10;