如果A表没有primary key 或者unique key,新建一个.然后 replace a select * from b
分两步。 1。 update a set a.fd=b.fd where a.id=b.id .... 2. insert into a select * from b where id > (select max(id) from a). [align=center]====思想重于技巧==== [/align] . 贴子分数<20:对自已的问题不予重视。 贴子大量未结:对别人的回答不予尊重。 .
replace a select * from b
1。 update a set a.fd=b.fd where a.id=b.id ....
2. insert into a select * from b where id > (select max(id) from a).
[align=center]==== 思想重于技巧 ====
[/align]
.
贴子分数<20:对自已的问题不予重视。
贴子大量未结:对别人的回答不予尊重。
.
update a set a.fd=b.fd where a.id=b.id
insert into a select b.* from b left join a on a.id=b.id where isnull(b.id)
insert into a select b.* from b left join a on a.id=b.id where isnull(a.id)