In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "SQL statement copies two field data in database table". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the idea of Xiaobian to study and learn "SQL statement copies two field data in database table" together.
SQL statement to copy data for two fields in a database table
Today, I added a new field to the table, but I want to have the same value as another field in the table. Due to too much data, I want to implement it through sql statements. After testing, the following sentence is really very good.
The copy code is as follows:
update jb51_temp set B=A
jb51_temp stands for indicating that A is a field with values, B is a newly added field, remember to put the null value table in front, if set a=b, then your values are empty, it is troublesome, it is recommended to backup the database before operation.
How to copy values from one field to another
For example, there are two fields A and B,A field is the value of "I",B field value is "they", how to use update statement to copy the value of B field into A, and A combination should be placed after the original content. After updating, field A should be "we" and field B unchanged.
The copy code is as follows:
update table set A=A+B
Thank you for reading, the above is the content of "SQL statement copying two field data in database table", after learning this article, I believe everyone has a deeper understanding of SQL statement copying two field data in database table, and the specific use situation needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
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.