解决mysql不能修改(You can't specify target table 'basic_data' for update in FROM clause)
来源:互联网 发布:国产windows平板电脑 编辑:程序博客网 时间:2024/05/20 16:09
今天遇到一个问题
You can't specify target table 'basic_data' for update in FROM clause
原句
UPDATE basic_data SET manage_user=4 WHERE id IN (SELECT b.id from basic_data b JOIN department d on d.id =b.department JOIN users u on u.department_id=d.id where d.id=1)
修改后
UPDATE basic_data SET manage_user=4 WHERE id IN (SELECT b.id from (SELECT * FROM basic_data) b JOIN department d on d.id =b.department JOIN users u on u.department_id=d.id where d.id=1)
原理 是mysql 把 查询子句当做一个临时表,不在当做一个实体表
- 解决mysql不能修改(You can't specify target table 'basic_data' for update in FROM clause)
- MySQL 修改报错 You can't specify target table 'tb_trade' 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 for update in FROM clause错误(转载)
- mysql update语句问题:You can't specify target table 'user' 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错误
- 用廉价的315M遥控模块实现数据传输 -小虫的机器人8元V35元的传输成本
- .net面试题(二)
- HDU 2069 母函数
- 音乐游戏&音频解析 ABC(下)
- Android View刷新机制
- 解决mysql不能修改(You can't specify target table 'basic_data' for update in FROM clause)
- 为什么白帽SEO总是更好
- 315M无线模块数据传输——深入研究 小虫的机器人8元V35元的传输成本
- Java数据结构与算法--对数据结构的概述
- 京东真快
- redis常用命令总结
- OpenCV 编码样式指南
- 关于jsp连接Oracle进行用户登录的方法文档总结:
- [1月21日的脚本] 如何使用指定的用户账号识别服务并修改密码