Multiple tables in Mysql delete the same ID record method _mysql

Source: Internet
Author: User
Tags mysql delete



The problem comes from a 5-year-old Baidu know the answer, just see this problem when I just went to work 21 days, then according to their own that little experience and the temporary operation of the test made the right answer at that time:


But was quickly denied, I guess the main reason is that I said the last word is too absolute, but because I too believe in themselves, and there are a lot of reasons to support, so there is no in-depth study.

Recently, a netizen commented on my answer, I began to check Baidu, found that Mysql4.0 above version can be deleted by a delete multiple table data.
It seems that I did in the fraught, can only say sorry, the landlord did not choose my answer, or sin big.

Finally, summarize:

MySql4.0 above supports delete multiple tables delete t1,t2 from T1.refid=t2.id

SQL Server is not supported until 2008

Oracle is virtually unused, unsure, and is found on the web is not supported delete data to delete multiple tables

For databases that do not support delete deletes multiple tables, you can do some upfront work, such as triggers, foreign keys.

You can implement "one delete" to delete data from multiple table and table.

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.