UPDATE sys_user a
leftjoin sys_dept b on a.dept_id = b.id
leftjoin sys_role_user c on c.user_id = a.id
set a.base =6where b.full_name like'aaaaaa%'and c.user_id isnotnull
Mysql的update-left join-where的联合使用UPDATE sys_user aleft join sys_dept b on a.dept_id = b.idleft join sys_role_user c on c.user_id = a.idset a.base = 6where b.full_name like 'aaaaaa%'and c.user_id is not null