This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10440|Reply: 0

[Solved] ERROR 1093 (HY000): You can't specify target table 'xxx' for upda...

[Copy link]
Posted on 7/17/2018 4:15:30 PM | | | |
ERROR 1093 (HY000): You can't specify target table 'xxx' for update in FROM clause
In MySQL, when writing SQL statements, you may encounter errors like You can't specify target table 'table name' for update in FROM clause, which means,You can't select some values in the same table before updating the table (in the same statement), that is, you cannot make a judgment based on the value of a field and then update the value of a field.



Wrong SQL statement:



SELECT the result through the middle table again, so as to avoid errors.

After modification, the correct sql statement:

It should be noted thatThis problem only occurs in MySQL, MSSQL and Oracle do not have this issue.




Previous:Several schemes for distributed crawlers to use proxy IPs
Next:Activate PyCharm online The complete method is effective
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com