You can't specify target table for update in FROM clause
来源:互联网 发布:exit code 0 python 编辑:程序博客网 时间:2024/06/17 00:02
今天使用mysql,写出一个sql语句:
update service_re set is_deleted=0 where id=(select id from service_re where p_id=21000122321 limit 1);
执行这样的sql会报一个异常:
You can't specify target table for update in FROM clause
查了资料,原来mysql不能那么用,mysql好愚蠢,为了实现这个目的,只能换一种写法:
update service_re set is_deleted=0 where id=(select b.id from(select a.id from service_re a where p_id=21000122321 order by gmt_create desc limit 1) b);给原来where中的表起一个别名,然后再查询出来,总之,不能直接在where中使用需要update,insert,delete的表的名字。
0 0
- mysql update语句问题:You can't specify target table 'user' for update in FROM clause
- You can't specify target table 'table name' for update in FROM clause
- MySql报错: You can't specify target table 'table name' for update in FROM clause
- 【MySQL】1093 You can't specify target table 'table name' for update in FROM clause
- [Err] 1093 - You can't specify target table 'table' for update in FROM clause处理
- You can't specify target table 't' for update in FROM clause
- Mysql - You can't specify target table 'dataproduct' for update in FROM clause
- You can't specify target table 'wms_cabinet_form' for update in FROM clause
- MySQL报错“ you can't specify the target table for ‘update’ in from clause”
- You can't specify target table 'sc1' for update in FROM clause
- [Err] 1093 - You can't specify target table 's' for update in FROM clause
- mysql中You can't specify target table for update in FROM clause错误
- You can't specify target table 'sdb_goods' for update in FROM clause
- You can't specify target table 'A' for update in FROM clause
- MYSQL 临时表 #1093 - You can't specify target table 'dealer_admin' 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错误
- Ubuntu开启Mod_rewrite模块
- 5-14 求整数段和
- Python爬虫入门-Beautiful Soup的用法
- MySQL学习笔记16:子查询
- 使用 ARIA 改善网页可访问性
- You can't specify target table for update in FROM clause
- 逆元逆元
- JAVA中,文件的输入输出(1)
- 为什么互联网大佬中,马化腾挨骂最多?
- 让ImageView的图片全屏填充
- MySQL学习笔记17:别名
- Linux 用命令行打开doc pdf
- 5-15 计算圆周率
- linux下禁用IPV6的方法