请问A表为主表 B表为导入表 字段a A,B表都存在
B表里a字段的数据与A表有重复
我想实现把B表a字段不与A表重复的内容导入A表
请问谁知道具体的SQL语句怎么写 

解决方案 »

  1.   

    insert into a(a) 
    select a from b where b.a not in (select distinct a from a)
      

  2.   

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

  3.   


    insert into A select * from B where a not in (select a from A)
      

  4.   

    请问A表为主表 B表为导入表 字段a A,B表都存在 
    B表里a字段的数据与A表有重复 
    我想实现把B表a字段不与A表重复的内容导入A表 
    请问谁知道具体的SQL语句怎么写 
    ---
    insert into A表 
    select 字段 from B表 where B表.字段a not in(select distinct 字段a from A表)