mysql SQL语句You can't specify target table ' for update in FROM clause解决
来源:互联网 发布:什么行业需要网络推广 编辑:程序博客网 时间:2024/06/07 03:45
昨天执行了这样一个批量删除的语句
DELETEFROMbd_countryWHEREid IN (SELECTidFROMbd_countryWHEREstatecode IS NULLAND citycode IS NULLAND nameCN IS NULL)然后出现了 [Err] 1093 - You can't specify target table 'bd_country' for update in FROM clause的错误,当时很纳闷 一直这样写的怎么会出现问题呢,它的意思是(你不能在FROM子句指定目标表更新),我想了想是不是以前我一直用的Oracle,Oracle可以但是Mysql不可以。
解决思路:既然Mysql不让对查询到的目标语句进行更新,那么我在它的上面在套一个子查询就可以。
DELETEFROMbd_countryWHEREid IN (SELECTtmp.idFROM(SELECTidFROMbd_countryWHEREstatecode IS NULLAND citycode IS NULLAND nameCN IS NULL) tmp)
0 0
- mysql SQL语句You can't specify target table ' for update in FROM clause解决
- mysql update语句问题:You can't specify target table 'user' for update in FROM clause
- mysql执行SQL语句时,出现You can't specify target table '表名' for update in FROM clause错误
- MySql报错: You can't specify target table 'table name' for update in FROM clause
- 【MySQL】1093 You can't specify target table 'table name' for update in FROM clause
- mysql的1093错误You can't specify target table 't' for update in FROM clause 简单解决
- 解决You can't specify target table 'tbmsg' for update in FROM clause
- Mysql - You can't specify target table 'dataproduct' for update in FROM clause
- MySQL报错“ you can't specify the target table for ‘update’ in from clause”
- mysql中You can't specify target table for update in FROM clause错误
- MYSQL 临时表 #1093 - You can't specify target table 'dealer_admin' for update in FROM clause
- MySQL "You can't specify target table 'X' for update in FROM clause" 错误解决方法
- Mysql 错误 Code: 1093. You can't specify target table for update in FROM clause
- mysql中You can't specify target table for update in FROM clause错误
- mysql问题:You can't specify target table for update in FROM clause
- mysql中You can't specify target table for update in FROM clause错误
- MYSQL 1093 - You can't specify target table '' for update in FROM clause
- mysql中You can't specify target table for update in FROM clause错误
- 关于Windows下python编码问题
- 自定义信号和槽
- Mac AppStore下载报错Use the Purchases page to try again
- 题目1179:阶乘
- Windows 10 Start Menu Troubleshooter发布:修复开始菜单问题,亲测100%可以解决
- mysql SQL语句You can't specify target table ' for update in FROM clause解决
- Lua中的元表与元方法学习总结
- mysql 跨服务器数据_导入/导出 csv
- CentOS下添加Root权限用户(超级用户)方法
- 几种java通信(rmi,http,hessian,webservice)协议性能比较
- linux常用命令
- Retrofit分析-漂亮的解耦套路
- 前端面试
- 常用排序算法稳定性、时间复杂度分析