In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Sometimes, we need to copy an entire column of data from one field to another new field, which is simple, SQL can write:
UPDATE tb_1 SET content_target = content_source
It is roughly written as follows:
Update {your_table} set {source_field} = {object_field} WHERE cause
It is better to have tools such as Navicat, you can directly select a column of data, copy and paste into the column you need. It's fine if it's the same table, and if it's a new table, keep their rows the same. If the number of rows is inconsistent, you can create a new table and copy the columns in so that the number of id will remain the same.
Sometimes these MySQL interface tools report errors, so it's better to use the command line. For example, to copy data from one table field to another table field, you can write:
UPDATE tb_1 INNER JOIN tb_2 ON tb_1.tid = tb_2.tidSET tb_1.tcontent = tb_2.tcontent
Here is a real-world example of writing a link to a static page that PHPCMS has generated into the url field in the phpcms_ content table:
First piece together the required url field columns like this.
SELECT CONCAT (FROM_UNIXTIME (inputtime,'%Y/%m%d'),'/', contentid, '.html') AS dt FROM phpcms_content ORDER BY contentid DESC
Then in the query editor (navicat), copy the entire copy to the url column in the phpcms_ content table.
Summary
The above is the whole content of this article. I hope the content of this article has a certain reference and learning value for everyone's study or work. Thank you for your support. If you want to know more about it, please see the relevant links below.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.