mysql 用一个表更新另一个表 子查询更新一个表
UPDATE cmf_user u, (
SELECT if(more ->> '$.mobile' IS NULL, '', more ->> '$.mobile') AS mobile
, user_id
FROM `cmf_third_party_user`
) b
SET u.mobile = b.mobile
WHERE u.id = b.user_id
AND u.mobile = ''
UPDATE a, b
SET a.title = b.title, a.name = b.name
WHERE a.id = b.id
最后更新于 2021-07-28 09:07:32 并被添加「」标签,已有 656 位童鞋阅读过。
此处评论已关闭