MySQL中执行sql语句错误 Error Code: 1093. You can't specify target table 'car' for update in FROM clause
2017-03-21 11:32
1036 查看
当执行以下sql语句时会出现 Error Code:1093 错误:
出现错误的原因是因为修改的表和查询的表是同一个表,MySQL是不允许这样做的,我们可以通过中间再查询一次来解决:
update car set tag = 1 where id in (select id from car where brand_id=182 and tag=0);
出现错误的原因是因为修改的表和查询的表是同一个表,MySQL是不允许这样做的,我们可以通过中间再查询一次来解决:
update car set tag = 1 where id in (select id from (select id from car where brand_id=182 and tag=0) As temp);
相关文章推荐
- mysql中错误:1093-You can’t specify target table for update in FROM clause的解决方法
- mysql中错误:1093-You can’t specify target table for update in FROM clause的解决方法
- Mysql 错误 Code: 1093. You can't specify target table for update in FROM clause
- MySQL 错误码: 1093 You can't specify target table 'jc_user' for update in FROM clause
- mysql错误:1093-You can’t specify target table for update in FROM clause的解决方法
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- MySQL报1093错误,MySQL can’t specify target table for update in FROM clause
- mysql中You can't specify target table for update in FROM clause错误 转
- mysql中You can't specify target table for update in FROM clause错误
- mysql Error Code: 1093. You can't specify target table 'base_extend' for update in FROM clause 0.001
- mysql中You can't specify target table for update in FROM clause错误
- mysql中You can't specify target table for update in FROM clause错误
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- 数据库删除重复属性列,错误[HY000][1093] You can't specify target table 'orders' for update in FROM clause
- mysql中You can't specify target table for update in FROM clause错误
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- mysql update语句问题:You can't specify target table 'user' for update in FROM clause
- mysql 出现You can't specify target table for update in FROM clause错误的解决方法
- MySQL 中 You can't specify target table '表名' for update in FROM clause错误解决办法
- mysql中You can't specify target table for update in FROM clause错误