mysql把一个表的字段update成另一个表的字段根据id
1.填充activity表里面的creator字段,用org的founderid,其中activity的orgid要和org的id对应,具体sql语句如下:
update activity a inner join (select id,founderid from org o) c on a.orgid =c.id set a.creator = c.founderid;
update activity a inner join (select id,founderid from org o) c on a.orgid =c.id set a.creator = c.founderid;