insert into table1(aa,bb)
  select aa,bb from table2
  where not exists(select * from table1 where table1.aa=table2.aa and table1.bb=table2.bb)

解决方案 »

  1.   

    insert into table1 
    select * 
    from table2
    where checksum(*) not in(select checksum(*) from table1)
      

  2.   

    insert into table1(aa,bb)
      select aa,bb from table2
      where not exists(select * from table1 where table1.aa=table2.aa and table1.bb=table2.bb)
      

  3.   

    insert into table1(aa,bb)
      select aa,bb from table2
      where not exists(select * from table1 where table1.aa=table2.aa and table1.bb=table2.bb)
      

  4.   

    insert into table1(aa,bb)
      select aa,bb from table2
      where not exists(select * from table1 where table1.aa=table2.aa and table1.bb=table2.bb)
      

  5.   

    insert into table1
    select * from table2
      where not exists(select * from table1 where table1.aa=table2.aa and table1.bb=table2.bb)