MySQL delete syntax alias problemFirst, confirm that the delete statement in MySQL supports aliases; When writing the delete syntax yourself, the statement is as follows: delete from tableA a where a.c_pk_id = '123' However, an alias usage error will be reported, as follows:
Through the query data, I learned that the syntax of MySQL delete is somewhat special, as follows: delete a from tableA a where a.c_pk_id = '123' Deleted successfully! ! ! After comparison, we can know that when using an alias in a delete statement, you need to write an additional alias after delete. Using alias in mysql delete statementgrammar: delete <alias> from <table> <alias> where <alias>.<field>... The alias must appear once after the delete. Deletion syntax between multiple tables: DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id; Or: DELETE FROM t1, t2 USING t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.id=t2.id AND t2.id=t3.id; LEFT JOIN: DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL; The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Talking about ContentType(s) from image/x-png
>>: Two methods to disable form controls in HTML: readonly and disabled
The relationship between Javascript and DOM is ve...
Prerequisites 1. Docker has been installed on the...
Introduction to MySQL Window Functions MySQL has ...
I recently used a Mac system and was preparing to...
Click here to return to the 123WORDPRESS.COM HTML ...
Table of contents 1.union: You can add query resu...
First method : CSS code: Copy code The code is as ...
Docker is a management tool that uses processes a...
Preface: The importance of database backup is sel...
Table of contents Overall Effect Listen for conta...
Since this is my first post, if there are any mis...
The installation of compressed packages has chang...
Call How to call Amap API? The official open docu...
Table of contents explain: Summarize Replenish Un...
The code demonstrates horizontal merging: <!DO...