In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail the example analysis based on delete grammar aliases in mysql. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
The problem of grammatical aliases in mysql delete
First of all, confirm that the delete statement in mysql supports aliases
When writing the delete syntax, the sentence is as follows:
Delete from tableA a where a.c_pk_id = '123'
However, an alias usage error is reported, as follows:
[Err] 1064-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near'q
WHERE
Q.C_PLY_NO = '1100107000404000220150000001'
AND q.N_EDR_PRJ_NO = '1cm' at line 3
By querying the data, we know that the syntax of mysql's delete is somewhat special, as follows:
Delete a from tableA a where a.c_pk_id = '123'
Deleted successfully!
After comparison, you can see that when using an alias, the delete statement should write an extra alias after delete.
Use the alias alias in mysql delete statements
Syntax:
Delete from where....
The alias must be given once after delete.
Delete syntax between multiple tables:
DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3WHERE t1.id=t2.id AND t2.id=t3.id
Or:
DELETE FROM t1, t2 USING t1 INNER JOIN t2 INNER JOIN t3WHERE 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; 's article on "sample analysis based on delete grammar aliases in mysql" ends here. I hope the above content can be helpful to you so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.