Problems with the MySQL DELETE statement

Source: Internet
Author: User
Tags mysql delete

Have encountered this problem a few times before, all feel that the problem is not big, so there is no record, but this time again met, and did not think of the first time, so there is a record of the necessary

MySQL DELETE statement throws when using a subquery to manipulate the same table

DELETE  from where inch (Selectfromwhereisnull )

[Err] 1093 - You can"ABC" for update in from clause

Workaround: Add a virtual intermediate table to relay

DELETE  from where inch (Select* fromwhere-isnull ) s  );

The same problem will exist when you update it.

Solved, but what is the principle? Not clear, I hope the great God see after the advice, thank you.

There is also a problem, the deletion of the time is not an alias

Delete  from where = ' Qeq ';
[Err] 1064 - inch Check  to  for  Right  to  Use '  'qeq'1

The alias is removed and can be executed normally.

Problems with the MySQL DELETE statement

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.