Error code: 1093. You can’t specify target table ‘car’ for update in from clause
Error code: 1093 error occurs when executing the following SQL statement:
update car set tag = 1 where id in (select id from car where brand_id=182 and tag=0);
The reason for the error is that the modified table and the queried table are the same table, which is not allowed in MySQL. We can solve the problem by querying again in the middle
update car set tag = 1 where id in (select id from (select id from car where brand_id=182 and tag=0) As temp);
Similar Posts:
- You can’t specify target table for update….
- [Solved] MYSQL Error: You can’t specify target table for update in FROM clause
- With check option in SQL
- Hive SemanticException:Expression not in GROUP BY
- [Solved] MYSQL ERROR 1093 – You can’t specify target table ‘readbook’ for update in FROM clause
- Error: not a group by expression [How to Solve]
- [Solved] MYSQL Error: “ Every derived table must have its own alias”
- [Solved] MYSQL Command gruop by Error: this is incompatible with sql_mode=only_full_group_by
- DB2 Database table operation error SQL0668N Operation not allowed for reason code “1” on table “db”. S…
- SQL0668N Operation not allowed for reason code “3” on table “TEST”. SQLSTAT…