Sometimes, we need to copy the data in the entire column of a field to another new field, which is very simple. The SQL statement can be written as follows:
UPDATE tb_1 SET content_target = content_source;
The syntax is as follows:
Update {your_table} set {source_field }={ object_field} WHERE cause
Tools such as Navicat are better. You can directly select a column of data and copy and paste it into the column you need. If it is the same table, there is no problem. If it is a new table, ensure that their rows are consistent. If the number of rows is different, you can create a new table and copy the columns to make sure that the number of IDS is consistent.
Sometimes these MySQL interface tools will report errors, and it is better to use the command line at this time. For example, to copy a table field data to another table field, you can write it as follows:
UPDATE tb_1 inner join tb_2 ON tb_1.tid = tb_2.tid
SET tb_1.tcontent = tb_2.tcontent
The following is an example of writing a link to a static page generated by PHPCMS to the url field in the phpcms_content table:
First, piece together the required url field columns.
Select concat (FROM_UNIXTIME (inputtime, '% Y/% m % d'),'/', contentid, '.html') AS dt FROM phpcms_content order by contentid DESC
Then, in the editor (navicat), copy the entire segment to the url column in The phpcms_content table.