The question was answered by Baidu five years ago. When I first saw this question, I had just been working for 21 days. Then, based on my own experience and Temporary Operation tests, I made a correct answer:
But soon I was denied. I guess the main reason is that the last sentence I said is too absolute, but because I believe in myself too much, and there are a lot of reasons to support it, I have not studied it in depth.
Recently, some netizens commented on my answer. I started to check Baidu and found that MySQL and later versions can delete data from multiple tables using one delete operation.
It seems that I am indeed mistaken, I can only say sorry, fortunately, the landlord did not select my answer, or else it would be a great sin.
Summary:
You can delete multiple tables in MySql4.0 or later versions.Delete t1, t2 from t1.refid = t2.id
SQL Server is not supported until 2008
Oracle is almost useless and uncertain. What I found online is that it does not support delete to delete data from multiple tables.
For databases that do not support delete to delete multiple tables, you can do some preliminary work, such as triggers and Foreign keys.
You can delete data in multiple tables in one row.