update temp1 a set (f1,f2,f3)=(select k1,k2,k3 from temp2 b where a.f4=b.k4 and a.f5=b.k5) where exists(select k1,k2,k3 from temp2 b where a.f4=b.k4 and a.f5=b.k5); 这样,如果temp2中没有对应的纪录,temp1的纪录不会被修改
update temp1 set (f1,f2,f3) = (select k1,k2,k3 from temp1 a,temp2 b where a.f4=b.k4 and a.f5=b.k5)
(f1,f2,f3)=(select k1,k2,k3 from temp2 b where a.f4=b.k4 and a.f5=b.k5)
where exists(select k1,k2,k3 from temp2 b where a.f4=b.k4 and a.f5=b.k5);
这样,如果temp2中没有对应的纪录,temp1的纪录不会被修改
= (select k1,k2,k3 from temp1 a,temp2 b where a.f4=b.k4 and a.f5=b.k5)
jlandzpa,你的方法好象不行啊,是搞错了吗?