insert into B select * from a left join B on a.id=b.id where b.id is null

解决方案 »

  1.   

    insert into B表
    select a.* from A表 a left join B表 b on a.编码=b.编码
    where b.编码 is null
      

  2.   

    或:insert into B表
    select * from A表 where 编码 not in(select 编码 from B表)
      

  3.   

    insert into a
      select * from b where 編碼 not in ( select 編碼 from a )
      

  4.   

    insert into B表
    select * from A表 where 编码 not in(select 编码 from B表)