1.多表update
语法形式:update tabel t1, table t2 set ... where t2.id = t1.id;
update table t1 inner join table t2 on t2.id = t1.id set ...;
也可以使用left join 或者 right join来做多表关联更新一表记录或多表记录。
2. 多表delete
1.多表update
语法形式:update tabel t1, table t2 set ... where t2.id = t1.id;
update table t1 inner join table t2 on t2.id = t1.id set ...;
也可以使用left join 或者 right join来做多表关联更新一表记录或多表记录。
2. 多表delete
转载于:https://www.cnblogs.com/ruhuanxingyun/p/10630466.html