In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how mysql implements merge statements similar to oracle. I hope you will get something after reading this article. Let's discuss it together.
One table An is updated periodically, but the data in the table comes from another table B. The structure of table An is the same as that of table B. when the data in table A does not exist in table B, the data in table B is added to table A. when the data in table An exists in table B (that is, the unique index items are the same), add the data from table B to table A. Insert into tableA selectfrom tableBon duplicate key update tableA.column= + tableB.column...;insert into tableA (key1,key2,col1,col2) select key1,key2,col1,col2from tableBon duplicate key update col1=col1+tableB.col1,col2=col2+tableB.col2;insert into tableA (key1,key2,col1,col2) select key1,key2,col1,col2from (here: it also can be a temp table) tableBon duplicate key update col1=col1+tableB.col1,col2=col2+tableB.col2 After reading this article, I believe you have a certain understanding of "how mysql implements merge sentences similar to oracle". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
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.