1、需求:
关联两个表a,b,有关键字关联,用一个b表里的数据列更新a表的字段。
2、sql文:
UPDATE a a INNER JOIN b b ON a.`project_id` = tp3.`ProjCardId` SET tpi.`project_guid` = tp3.EXTRA1 WHERE tpi.`create_by` = 'liu' ;
另一个
update B,A set B.memo=A.memowhere A.order_id=B.order_id and (B.memo is null or B.memo='');