Solution for MySQL update with Error Code: 1093 and Error Code: 1175

Source: Internet
Author: User
Tags mysql update

MySQL update Error Code: 1093 and Error Code: 1175 solution MySQLSQLError Code: 1093. you can't specify target table 'ws _ product' for update in FROM clause, which is caused by the subquery added to the where condition when the update or delete statement is used. For example, the following update statement:

Update table set type = 'state' where id in (select id from ws_product where first_name = 'superman ');

 

Modify the preceding statement as follows to solve the problem:
Update ws_product set type = 'static 'where id in (select id form (select id from ws_product where first_name = 'superman') xx );

 

Error Code: 1175. you are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences-> SQL Queries and reconnect. the solution is to execute the following statement in the current session:
SET SQL _SAFE_UPDATES = 0;

 

Then execute the Update statement.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.