update 多表关联。
两个表结构是一样的,customer2是有最新的数据。
而customer1的数据要从customer2得到。根据id1,id2来判断。
customer1(id1,id2,name1,name2)
customer2(id1,id2,name1,name2)
现在我想根据customer2的数据更新到customer1中。
在SQL 2000中是这样写的,
update customer1
set name1=b.name1
name2=b.name2
select customer1 a,
customer2 b
where a.id1=b.id1
and a.id2=b.id2
这该怎么改? 谢谢