使用pl/sql工具 select * from table 其记录数大于65535,由于excel中单sheet最大记录数只有65535,我是手工选择粘贴的,这样很麻烦。
请问有没有什么好方法可以实现excel中自动分sheet,或者利用select的条件限定,第一次返回前6万条记录,第二次返回60001到120000条,....
谢谢各位大虾了。

解决方案 »

  1.   


    --参考一下:
    SQL> select * from tab;A                 B
    -------- ----------
    0121          60.00
    012101        70.00
    0122         110.00
    0124         230.00
    012303        45.00
    0123          80.006 rows selectedSQL> select *  from ( select rownum rn,tab.* from tab ) t where  t.rn<=2;        RN A                 B
    ---------- -------- ----------
             1 0121          60.00
             2 012101        70.00SQL> select *  from ( select rownum rn,tab.* from tab ) t where t.rn>2 and t.rn<=4;        RN A                 B
    ---------- -------- ----------
             3 0122         110.00
             4 0124         230.00SQL> select *  from ( select rownum rn,tab.* from tab ) t where t.rn>4 and t.rn<=6;        RN A                 B
    ---------- -------- ----------
             5 012303        45.00
             6 0123          80.00SQL> 
      

  2.   

    select的时候利用条件过滤,一部分一部分查出来,然后查出来的记录,直接可以copy to excel。
      

  3.   


    例:select * from(select t.*,rownum rn from tableName t) where rn<100
    select * from(select t.*,rownum rn from tableName t) where rn between 100 and 200;
    select * from(select t.*,rownum rn from tableName t) where rn>200
      

  4.   

    数据量大还是要效率,避免全表扫描select * from(select t.*,rownum rn from tablename t where rownum<200) where rn >=100
      

  5.   

    不知道PLSQL支持execl 2007 的格式否