mysql用查询结果当删除的判断条件进行删除报错1093 You can't specify target table解决方法 #分开两个sql执行正常的语句,只保留最新1000条数据,删掉1000条以前的旧数据select number from historydata order by number desc limit 1001,1;delete from historydata where number < 201911270538;#直接合并后报错:错误代码: 1093 You can…
不同于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…
数据库里面有两个字段的位置不对,要把他们对调换下.因为没有数据库写的权限,需要用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…
错误代码如下: #(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='邓维杰')); 报错:…
为了修复节点表某批次数据的用户数据,做出了以下尝试: , name , , )); 执行:[Err] 1093 - You can't specify target table 'zs_work_approval_node' for update in FROM clause 百度查询提示得知: update语句中包含的子查询的表和update的表为同一张表时,报错:1093-You can’t specify target table for update in FROM clause mys…
大家好,我是小皓. 一.背景 今天在博主练习MYS创建表操作时遇到一个语法报错,就想着来和大家分享一下MYSQL如何在创建表时添加判断条件: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[if not exists] tb_name(…
mysql中大数据表alter增加字段报错:"1034 Incorrect key file for table 'table_name'; try to repair it" 现象描述: mysql中大数据表执行alter增加字段时,/tmp的目录爆满,并且报错"1034 Incorrect key file for table 'table_name'; try to repair it". 故障分析: 1.查询MySQL官网得知: *“ALTER TABLE运…
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 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…
集群需要mysql存储元数据,就在前几天还运行好好的,突然就进不去了......还是太菜,遇到的bug少. 引起这种故障的原因有很多......第一个坑比较多,大部分用户也就用第一个就可以解决问题,我第一次也踩了第一个坑:这次出现这个问题的时候,发现不管用了,各种百度啊.....最后是发现第三个坑 1.第一个坑:密码不对--免密模式改密码: 2第二坑:user表有匿名用户,把匿名用户删除掉即可 3第三坑:localhost不对应 2.第四坑:user表下password_expired对应字段为…