You can’t specify target table for update in from clause in MySQL. This error means that you can’t select some values of the same table in the same SQL statement before updating the table. (not the same table)
Then execute to update the content of the first message of each user to Hello world
Because in the same SQL statement, select the minimum ID value of each user message in the message table first, and then update the message table, error 1093 (HY000): you can’t specify target table ‘message’ for update in from claim will appear.
Solution: select the result through an intermediate table again to avoid this error (including delete)
Modify after where condition
Note that only MySQL has this problem, and neither MSSQL nor Oracle has this problem.
Similar Posts:
- You can’t specify target table for update….
- mysql 1142 – SELECT command denied to user ‘root_ssm’@’localhost’ for table …
- [Solved] MySQL Error Code: 1093. You can’t specify target table ‘car’ for update in …
- With check option in SQL
- [Solved] sql Error: You can’t specify target table ‘tb_cr_circulate_gtsc’ for update in FROM clause
- [Solved] MYSQL Error when deleting a table: Cannot delete or update a parent row: a foreign key constraint fails
- NodeJS Connect MYSQL Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
- [Solved] MYSQL ERROR 1093 – You can’t specify target table ‘readbook’ for update in FROM clause
- MySQL Execute update error: Error Code 1175 [How to Solve]
- 12 Methods of SQL Error Injection [How to Inject]