原文:You can't specify target table 'xxx' for update in FROM clause

执行sql语句报上面的错误: 报错如下所示You can t specify target table xxx for update in FROM clause。 原因:因为在MYSQL里,不能先select一个表的记录,在按此条件进行更新和删除同一个表的记录。 详细参考:https: blog.csdn.net h article details 待续...... ...

2019-05-12 09:52 0 1188 推荐指数:

查看详情

You can't specify target table 'a' for update in FROM clause

项目中有一个功能变动上线,其中有一张表ttt的字段cc,历史数据需要处理,把字段cc中为’xxx’的值替换为'yyy'。 表A结构如下: 更新sql如下: 执行报错: Duplicate entry 'xx-xx-yyy' for key 'uk_aa_bb_cc' 因为相同的aa ...

Thu Feb 21 23:20:00 CST 2019 0 1887
mysql出现You cant specify target table for update in FROM clause

在mysql执行下面语句时报错: 括号里的子查询和外面的upadate语句均没错,但加在一起便报错了。 那是因为那串英文错误提示就是说, 不能先select出同一表中的某些值, 再update这个表(在同一 ...

Mon Jul 22 17:43:00 CST 2019 0 1492
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM