select * into t3 from
(select * from t1 where not exists(select 1 from t2 where t1.单位名称=t2.单位名称 and t1.姓名=t2.姓名 and t1.金额=t2.金额)
union 
select * from t2 where not exists(select 1 from t1 where t1.单位名称=t2.单位名称 and t1.姓名=t2.姓名 and t1.金额=t2.金额) a

解决方案 »

  1.   

    select * into 新表 from (
    select * from 表1 where not exists (select 1 from 表2 where 表1.单位名称=表2.单位名称 and 表1.姓名=表2.姓名 and 表1.金额=表2.金额)
    union all
    select * from 表2 where not exists (select 1 from 表1 where 表1.单位名称=表2.单位名称 and 表1.姓名=表2.姓名 and 表1.金额=表2.金额) ) tem
    select * from 新表
      

  2.   

    select * into newtable from 
    (select * from table1 as A where not exists 
     (select * from table2 where 单位名称=A.单位名称 and 姓名=A.姓名 and 金额=A.金额)
    union all
     select * from table2 as B where not exists 
     (select * from table1 where 单位名称=B.单位名称 and 姓名=B.姓名 and 金额=B.金额)
    ) C