fieldA 既为key怎么会有重复值?

解决方案 »

  1.   

    insert tableC(filedA,filedB) select * from tableA
    update b set b.fieldC = a.filedC from tableB a,tableC b where a.filedA = b.filedA
    insert tableC(filedA,filedC) select a.* from tableB a left outer join tableC b on a.filedA = b.filedA where b.filedA is null
      

  2.   

    select case when a.fieldA is not null thena.fieldA else b.fieldA end as fieldA,fieldB,fieldC from tableA a full outer join tableB b on a.fieldA=b.fieldA
      

  3.   

    insert tableC(filedA,filedB,filedC)
    select case when a.fieldA is not null thena.fieldA else b.fieldA end as fieldA,fieldB,fieldC from tableA a full outer join tableB b on a.fieldA=b.fieldA