问题描述:有个数据表test,有个字段value,如下 mysql> select * from test;+----+------------------------------------+| id | value |+----+------------------------------------+| 3 | 3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || 4 | 4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || 5 | 5aaaaaaa…
MySQL中执行sql语句错误 Error Code: 1093. You can't specify target table 'car' for update in FROM clause 2017年03月21日 11:32:46 回归心灵 阅读数:686   版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/u010657094/article/details/64439486 当执行以下sql语句时会出现 Error Code:1093 错…
关键词:mysql update,mysql delete update中无法用基于被更新表的子查询,You can't specify target table 'test1' for update in FROM clause. 情况如下: (1)第1行更新语句中,update表与子查询中表一样,所以报错 (2)第2行更新语句中,update表与子查询中表不一样,所以可以执行. 如何解决? 把子查询换成join即可. 例如: 总结: (1)在update与delete中,都不能再以子查询的方…
mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表(在同一语句中). 例:DELETE from sys_org_relation where pOrgid in ( select porgId from sys_org_relation   r  where  r.corgid='客户id' and relationType=1112 )  and…
数据库里面有两个字段的位置不对,要把他们对调换下.因为没有数据库写的权限,需要用sql语句来实现.原来以为简单的 update table a set a.字段a=(select b字段 from table  where id=?) ,set a.字段b=(select a字段 from table where id=?) where id=? ,结果报了 这个问题 You can't specify target table 'wms_cabinet_form' for update in…
Mysql update in报错 解决方案: [Err] 1093 - You can't specify target table 'company_info' for update in FROM clause 意思是不能在同一语句中更新select出的同一张表元组的属性值 解决方法:将select出的结果通过中间表再select一遍即可. 错误sql: update company_info set email = 'ttt@163.com' ) 修改后可执行的sql: update c…
不同于oracle和sqlserver,mysql并不支持在更新某个表的数据时又查询了它,而查询的数据又做了更新的条件,因此我们需要使用如下的语句绕过: , notice_code ) a) ; 本地测试是通过的,但是在上到测试环境的时候,发现还是会报如下错误: , notice_code ) a) ; - You can't specify target table 'teaching_department' for update in FROM clause 对比版本发现,本地是5.6.25…
错误代码如下: #(8) 把"邓维杰"同学的成绩全部删除. SELECT * FROM sc WHERE EXISTS(SELECT * FROM student WHERE student.sno=sc.sno AND student.sname='邓维杰'); DELETE FROM sc WHERE degree IN(SELECT degree FROM sc WHERE sno=(SELECT sno FROM student WHERE sname='邓维杰')); 报错:…
问题 You can't specify target table 'user_cut_record_0413' for update in FROM clause 原因 待更新/删除的数据集与查询的数据集撞车了,可以给后面的数据集加个别名,来解决撞车问题 报错语句 delete from user_cut_record_0413 where record_id IN ( select record_id from user_cut_record_0413 GROUP BY record_id…
做地址管理时,需要先根据要设为默认的地址的用户将用户的其他地址都设置为非默认 需要select出用户id然后update 原语句 update address set isdeafult = 0 where user_id = (select user_id from address where id = ?) 报错 -- You can't specify target table 'address' for update in FROM clause 大意是不能先select出同一表中的某些…