为何不用
insert into a (a1,a2)select b1,b2 from b,然后再update呢。是不是a字段设了主键。或者不为空。如果是那样,可以先去掉constraint,插入以后,更新完毕,再补上constraint。还有一种方式是使用trigger before insert or update。先给a附值。然后随你操作。