您的位置:首页 > 博客中心 > 数据库 >

mysql中批量update数据

时间:2022-03-15 07:36

创建临时表

 

 

UPDATE sys_user,
(
SELECT
min(id) AS id
FROM
sys_user
WHERE
invitation_expert_user_id = ‘8a2ebe035de8881e015e134139442b93‘
AND type = 4
AND del_flag = 0
GROUP BY
id
) AS tmp
SET sys_user.invitation_agent_user_id = ‘014282c8c3de4d80ab2c4f72d384d6c2‘,
sys_user.remarks = ‘高洪蛟老师做代理之前作为医生邀请的医生‘
WHERE
sys_user.id = tmp.id

 

热门排行

今日推荐

热门手游