a表上千万,B表30万,
b中一个字段和a中是相同(作为条件)
现需要将b在a中存在的信息提取出来,放到另外一个表里

解决方案 »

  1.   

    select * from b where b.相同字段  in (select a.相同字段 from a)查出数据再将数据插入要写入的表中。
      

  2.   

    create table new_table as select * from a where rownum<0;
    insert into new_table  select * from a join b on a.相同字段=b.相同字段
      

  3.   

    create table new_table as 
    select b.*
    (
    select b.*,a.field as filed_flag
      from a,b
     where a.field=b.field
    )
    where field_flag is not null
       
      

  4.   

    create table new_tab as
    select b.* from a,b where a.相同字段 = b.相同字段