The target table tablename of the UPDATE is not updatable---解决

今天碰见这个问题,看网上的答案啊,真的是。。
写一个测试简单说一下。
mysql–报错是这个The target table t2wkk of the UPDATE is not updatable
在这里插入图片描述
因为我写的是要更新a,但是我后面的set写成了给b赋值,所以不对,正确的应该是

update t1wkk as a join (select id,`name`,money FROM t2wkk) as b 
on a.id = b.id set a.money = b.money;

正确的链接: mysql里一次更新多条数据详细用法.

猜你喜欢

转载自blog.csdn.net/weixin_45906830/article/details/111562071
今日推荐