In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the MySQL select, insert, update batch operation statement example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
In a project, you often need to use batch operation statements to operate on data. When using batch operation statements, you need to pay attention to the condition restrictions of MySQL database. Here is mainly the data size limit. Here, the basic operations of batch insert, batch search and batch update are simply summarized.
1. Batch insert insert statements. The following statements have tried 1W + batch insert in the test environment, and the specific quantity is related to the table structure and field content.
INSERT INTO SYS_TEXT_PUSH (PUSH_ID, USER_UM_ACCOUNT, USER_NAME, SECTION, USER_MOBILE, PUSH_STATUS, PROMOTE_ID, CREATED_BY, CREATION_DATE, ENABLED_FLAG) values (# {item.pushId}, # {item,userUmAccount}, # {item.userName}, # {item.section}, # {item.userMobile} # {item.pushStatus}, # {item.promoteId}, # {item.createdBy}, # {item.creationDate}, # {item.enabledFlag})
2. Batch select query statements
SELECT * FROM SYS_TEXT_PROMOTE WHERE TEXT_PUSH_FLAG = 1 AND PROMOTE_ID IN # {item}
3. Batch update statements.
In the first case, the values to be updated are the same:
Update SYS_TEXT_PUSH SET PUSH_STATUS = 1, LAST_UPDATE_DATE = NOW () WHERE PUSH_ID IN # {item}
The second case is that the values to be updated are different:
Update SYS_TEXT_PUSH SET PUSH_STATUS = # {item.pushStatus}, LAST_UPDATE_DATE = NOW () WHERE PUSH_ID = # {item.pushId} Thank you for reading this article carefully. I hope the article "sample Analysis of batch Operation sentences of select, insert and update in MySQL" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.