1.select * from a left where not exist(select * form  b where b.id=a.id));
将结果写入另一个表c2. 同上1,2用union联合

解决方案 »

  1.   

    insert into c (
    select * from a where not exists (select * form b where id=a.id)
    union all
    select * from b where not exists (select * form a where id=b.id))
      

  2.   

    CREATE PROCEDURE procTabC_AddRecords
    as
    insert into c(
    select * from a where not exists (select * form b where id=a.id)
    union all
    select * from b where not exists (select * form a where id=b.id))你最好還是把三個表關聯的字段寫出來!