MySQL certain columns of a table data, copied to another table, and modify the contents of certain

 

MySQL? Will some of the columns in a table of data copied to another table

INSERT INTO t_topic_content(content,topicId) SELECT content,id FROM t_topic;

Note: assignment to a column of data, from growth, then the data should not be inserted


MySQL? Will some of the columns in a table of data copied to another table, and modify some content . As above, but when queried using REPLACE (str, from_str, to_str) function

INSERT INTO t_topic_content(content,topicId)
  SELECT REPLACE(content, 'aa', 'bb'),id FROM t_topic

Guess you like

Origin www.cnblogs.com/fengff/p/10978920.html