insert into
select a.f1 as f1,b.f1 as f2,b.f2 as fs
from t2 as b inner join t1 as b
where a.f1+b.f1+b.f2 not in (select f1+f2+f3 from t3 )

解决方案 »

  1.   

    insert into t3( f1 ,f2 ,f3) select t1.f1,t2.f1,t2.f2 from t1,t2 ,t3 where 
                 t1.f1<> t3.f1 and t2.f1<> t3.f2 and t2.f2<> t3.f3
      

  2.   

    insert into t3(f1,f2,f3)
    select a.f1 as f1,b.f1 as f2,b.f2 as fs
    from t2 as b inner join t1 as b
    where a.f1+b.f1+b.f2 not in (select f1+f2+f3 from t3 )
      

  3.   

    我的写法错了,不好意思
    补充:insert into t3( f1 ,f2 ,f3) select t1.f1,t2.f1,t2.f2 from t1,t2 ,t3 where 
                   t1.f1<> t3.f1 or t2.f1<> t3.f2 or t2.f2<> t3.f3