gpt4 book ai didi

mysql - 错误 1093 Mysql

转载 作者:行者123 更新时间:2023-11-29 21:57:53 24 4
gpt4 key购买 nike

Hello , when I try this:

 UPDATE SET managedBy_id=(SELECT id FROM users  as managedBy_id WHERE login=123456) WHERE login=72584; 

The output is: Error Code: 1093. You can't specify target table 'users' for update in FROM clause 0.000 sec

最佳答案

您的UPDATE语句错误,请修改为

UPDATE users 
SET managedBy_id = CASE WHEN login=123456 THEN id ELSE managedBy_id END
WHERE login=72584;

关于mysql - 错误 1093 Mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32957299/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com