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
Preface This article was written by a big shot fr...
Table of contents 1. Test experiment 2. Performan...
Create a table create table order(id varchar(10),...
1. What is Parallax scrolling refers to the movem...
Effect picture (if you want a triangle, please cl...
Introduction to NFS NFS (Network File System) is ...
<br /> The website access speed can directly...
Table of contents 1. Introduction to Jenkins 2. I...
Diversifying website layouts is our front-end spe...
ref definition: used to register reference inform...
ffmpeg is a very powerful audio and video process...
1. Avoid declaring the page as XML type . The pag...
1. Check the kali linux system version Command: c...
When the server needs to be started during develo...
Table of contents Use of CURRENT_TIMESTAMP timest...