mysql You can't specify target table 'xxx' for update in FROM clause的解决
DELETE from sp_goodscontent where goodsId in (SELECT t.goodsId from (
SELECT goodsId FROM sp_goodscontent GROUP BY goodsId
HAVING count(1)>1 ) t)
之前的sql 查询,需要改成中间临时表再查询
mysql You can't specify target table 'xxx' for update in FROM clause的解决的更多相关文章
- 错误:You can't specify target table 'xxx' for update in FROM clause的解决
问题: 今天在MySQL数据库删除重复数据的时候遇到了一个问题.如下脚本: DELETE FROM tempA WHERE tid IN ( SELECT MAX(tid) AS tid FROM t ...
- mysql You can't specify target table 'xxx' for update in FROM clause
含义:您不能在子句中为更新指定目标表'xxx'. 错误描述:删除语句中直接含select,如下: DELETE FROM meriadianannotation WHERE SeriesID IN ( ...
- You can't specify target table 'xxx' for update in FROM clause
1.执行sql语句报上面的错误: DELETE FROM db_student WHERE RowGuid IN ( SELECT RowGuid FROM db_student WHERE age ...
- mysql You can't specify target table 'sys_org_relation' for update in FROM clause 删除表条件不能直接包含该表
mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表( ...
- 关于mysql 5.7版本“报[Err] 1093 - You can't specify target table 'XXX' for update in FROM clause”错误的bug
不同于oracle和sqlserver,mysql并不支持在更新某个表的数据时又查询了它,而查询的数据又做了更新的条件,因此我们需要使用如下的语句绕过: , notice_code ) a) ; 本地 ...
- Mysql -- You can't specify target table 'address' for update in FROM clause
做地址管理时,需要先根据要设为默认的地址的用户将用户的其他地址都设置为非默认 需要select出用户id然后update 原语句 update address set isdeafult = 0 wh ...
- django.db.utils.OperationalError: (1093, "You can't specify target table 'xxx' for update in FROM clause")
这个错误的意思是,不能在update某张表的where条件中,再次select这张表的某些值作为筛选条件,比如: update message set content = "hello&qu ...
- mysql You can't specify target table 'sys_right_menu' for update in FROM clause (不能从Objor子句中指定目标表“SysRyType菜单)
错误语句: DELETE from sys_right_menu where right_id in (SELECT m.right_id from sys_right_menu mLEFT JO ...
- Mysql You can't specify target table 'newsalrecord' for update in FROM clause
这个问题是不能先select出同一表中的某些值,再update这个表(在同一语句中),即不能依据某字段值做判断再来更新某字段的值.解决办法就是建立个临时的表.
随机推荐
- Snapde和Excel、PowerPivot、WPS打开超大CSV文件性能比较
Snapde,一个专门为编辑超大型数据量CSV文件而设计的单机版电子表格软件:它运行的速度非常快,反应非常灵敏. 我们拿四份文件进行测试,对比一下他们打开大文件的性能:loan_theme_ids.c ...
- springboot2.0拦截器和webconfigure配置
接下来介绍一下springboot如何配置拦截器,很简单,只需要两个配置文件就可以了 首先配置登陆拦截器 @Component public class LoginInterceptor implem ...
- QT连接postgreSQL
这是我之前项目遇到的问题,连接postgreSQL数据库,一直找不到引擎,最后终于找到 原因了,需要程序加载 1.安装postgresql客户端,2.需要配置postgresql客户端的bin和lib ...
- js中innerHTML、outerHTML与innerText的用法与区别
____________________________________________________________________________________________________ ...
- 一个简易的kmp教学并给出java实现
简单介绍一下问题 给定source字符串,找出target字符串出现的首位 例如 source 为“abddabddabc” target 为 “abddabc” 从第一位开始比较 |a b d ...
- C#基础知识之IOC
依赖注入:http://www.cnblogs.com/leoo2sk/archive/2009/06/17/1504693.html IOC:https://jinnianshilongnian.i ...
- IDEA Can't Update No tracked branch configured for branch master or the branch doesn't exist.
IDEA Can't Update No tracked branch configured for branch master or the branch doesn't exist.To make ...
- Linux 系统假死的解决方案
Linux 系统有时因为软件不兼容或未知 bug,导致系统假死.比如我的 Ubuntu 14.04 最近使用 vscode 时偶尔会导致系统假死,即鼠标可以移动,但点击无反应. 此时可试试如下解决方案 ...
- 编译装php7.2 && nginx-1.14
环境准备 # cat /etc/centos-release CentOS Linux release 7.6.1810 (Core) # uname -r 3.10.0-957.el7.x86_64 ...
- 使用 canvas 画图时图像文字模糊的解决办法
最近在使用 canvas 画图的时候,遇到了图像文字模糊的问题,解决思路就是根据分辨率创建不同尺寸的画布.以下是创建高分辨率画布的代码: /** * 创建高分辨率画布 * @param w 画布宽 * ...