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

此处评论已关闭