本节内容:
mysql/ target=_blank class=infotextkey>mysql数据库中的多表update更新实例。
例子:
复制代码 代码示例:
-- 方式1
update uc_organization,uc_users
set uc_organization.org_name=uc_users.nick_name
where uc_organization.uid=uc_users.uid and (uc_organization.org_name is null or uc_organization.org_name='')
-- 方式2
update uc_organization inner join uc_users
on uc_organization.uid = uc_users.uid
set uc_organization.org_name=uc_users.nick_name
where uc_organization.org_name is null or uc_organization.org_name=''