Mysql:You can't specify target table for update in FROM clause的解决办法
You can’t specify target table ‘表名’ for update in FROM clause
意思是 不能先select出同一表中的某些值,再update这个表
原SQL语句:
update push_to_cloud
set is_confirm = 1 , direction = 1
where student_code = 01
and `snap_time`= (select max(`snap_time`)from push_to_cloud )
出现这种情况,只需要通过中间表select一遍就可以了。
解决办法:
update push_to_cloud
set is_confirm=1,direction=1
WHERE student_code = 01
and `snap_time` =(select a.time from (select MAX(snap_time) time from push_to_cloud ) a )
如果出现
Every derived table must have its own alias
检查是不是没有给表取别名
Mysql:You can't specify target table for update in FROM clause的解决办法相关推荐
- mysql 1093 you can_mysql中错误:1093-You can’t specify target table for update in FROM clause的解决方法...
发现问题 最近在处理一些数据库中数据的时候,写了下面的这一条sql语句: UPDATE f_student SET school_id = 0 WHERE id > ( SELECT id FR ...
- mysql错误:1093-You can’t specify target table for update in FROM clause的解决方法
在做更新操作的时候,赋值操作用了子查询,这个时候Mysql就报了如标题的错误. 解决方法:子查询需要再包裹一层 把他当成一个新表 然后通过新表查询出来的值 来赋值. 这个方法只适用于你的查询和更新操作 ...
- MySQL 1093 You can't specify target table for update in FROM c 的解决办法
执行SQL语句时出现这个错误.原因是在更新这个表和数据时又查询了它,而查询的数据又做了更新的条件. 以前ORACLE上面没有这个错误.DELETE FROM comments WHEREid = (S ...
- MYSQL之You can't specify target table for update in FROM clause解决办法
MYSQL之You can't specify target table for update in FROM clause解决办法 2016年12月21日 15:24:23 阅读数:19272 这篇 ...
- mysql修改重复数据You can‘t specify target table ‘‘ for update in FROM clause
You can't specify target table '' for update in FROM clause 得修改成下边的写法 update 景区与景区表 set 距离='',驾车时间=' ...
- You can't specify target table for update in FROM clause
今天使用mysql,写出一个sql语句: update service_re set is_deleted=0 where id=(select id from service_re where p_ ...
- 【sql】You can‘t specify target table for update in FROM clause
今天写mysql的时候出现了You can't specify target table for update in FROM clause问题,错误的意思是说,不能先select出同一表中的某些值, ...
- Mysql 错误 Code: 1093. You can't specify target table for update in FROM clause
You can't specify target table 'recharge_log' for update in FROM clause 这个问题出现的情况是: 更新一个表的数据时,where条 ...
- MySQL异常一之: You can‘t specify target table for update in FROM clause解决办法
文章目录 前言 一.bug描述 二.需求描述 三.错误做法 四.正确写法 1. 正确 sql 2. sql 片段解释: 前言 总结SQL中的bug问题 一.bug描述 You can't specif ...
最新文章
- 9000+ 字,彻底征服 Spring AOP ,美滋滋
- 解题报告:hdu 1276 士兵队列训练问题 - 简单题
- 安卓应用安全指南 4.8 输出到 LogCat
- 如何从外网向内网传东西_鱼缸内出现气泡还会不断缓缓升起,是什么东西,如何处理和解决?...
- 字符串单词翻转c语言,C语言反转一行字符串单词示例
- python有哪些用途-python是什么?python的用途
- 机器学习案例系列教程——距离度量方法总结
- 域名注册管理相关的三个机构:ICAAN、interNIC、CNNIC
- 【GPU加速】笔记本双显卡如何切换
- mzy,struts学习(二):struts.xml的配置
- Hadoop HA 高可用
- linux777命令,linux权限777 命令是什么意思
- poj 1284 Primitive Roots 求素数元根数
- 谷歌浏览器好用的复制粘贴插件_好用到炸的谷歌chrome浏览器必备扩展插件(一)...
- 数据库面试——锁的12连问,赶紧收藏!
- 倍福--CAB文件的配置
- 已知由单链表表示的线性表中含有三类字符(数字,字母和其他字符)试编写算法来构造三个循环链表,使每个表中只含某一类字符,且利用原表中的结点空间作为这三个表的结点空间,头结点可另辟空间。
- 数据挖掘实战(6)——机器学习实现文本分类(今日头条tnews数据集)
- 将Excel表格数据转为SQL语句
- 如何搭建Git服务器
热门文章
- oracle匹配靓号的正则表达式_靓号正则表达式匹配 疑问
- Can‘t resolve ‘element-plus/lib/el-button‘报错
- Change maker problem-找零(1-99美分)
- 8088微处理器主要引线
- Mini-batch 梯度下降 与Tensorflow中的应用
- opencv中的各种滤波函数
- Linux磁盘 - fdisk,partprobe, mkfs, mke2fs, fsck, badblocks, mount, mknod
- 盘点分布式文件存储系统____分布式文件存储系统简介
- 11.孩子被欺负了怎么办?
- [WIN32]Win7软件部署清单