(原)mysql错误1093 You can't specify target table 'wms_cabinet_form' for update in FROM clause
来源:互联网 发布:直销软件xajczxrj 编辑:程序博客网 时间:2024/06/04 20:26
这个错误的意思是不能先select出同一表中的某些值,再update这个表(在同一语句中),解决方法不直接查询同一个,假设要更新的表为A,则先将A的的数据放到表B,再从表B中查询则得到更新和查询表A的效果
例:
成绩表:
把“SC”表中“姚明”老师教的课的成绩都更改为此课程的平均成绩
update sc set score=(select avg(a.score) FROM (select score,C from sc) a where a.C in (select C from course left join teacher on course.T=teacher.T where Tname='姚明') group by a.C) where C in (select C from course left join teacher on course.T=teacher.T where Tname='姚明')
其中红色字体就将sc的数据放到一个临时表a中,再查询表a
0 0
- (原)mysql错误1093 You can't specify target table 'wms_cabinet_form' for update in FROM clause
- You can't specify target table 'wms_cabinet_form' for update in FROM clause
- mysql 一个较特殊的问题:You can't specify target table 'wms_cabinet_form' for update in FROM clause
- mysql 一个较特殊的问题:You can't specify target table 'wms_cabinet_form' for update in FROM clause
- mysql 一个较特殊的问题:You can't specify target table 'wms_cabinet_form' for update in FROM clause
- MySQL 错误码: 1093 You can't specify target table 'jc_user' 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错误(转载)
- mysql中You can't specify target table 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中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错误解决方法
- centos安装cobbler
- 将博客搬至CSDN
- 几门编程语言的学习网站
- (转)mysql 错误1175
- html+css基础(续)
- (原)mysql错误1093 You can't specify target table 'wms_cabinet_form' for update in FROM clause
- vim设置背景颜色
- HDU - 5004 KAMI(回溯+dfs)
- 升级docker到1.3
- 团队协作之AAR(任务后检视方法)
- 使用VS2010开发ActiveX(MFC)控件(3)——添加接口及WEB调用
- 利用开源组件commons-fileupload上传图片文件(2)
- Android很全常用工具类源码
- php实现简单验证码