我有一个“结果”表,其中有一个日期时间列“created_time”。此表引用另一个表“results_values”(results.id 引用 results_values.results_id)。这里有表格描述:
mysql> describe webforms_results;
+------------------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| webform_id | int(11) | NO | | NULL | |
| store_id | int(11) | NO | | NULL | |
| customer_id | int(11) | NO | | NULL | |
| customer_ip | bigint(20) | NO | | NULL | |
| created_time | datetime | NO | | NULL | |
| update_time | datetime | NO | | NULL | |
| approved | tinyint(1) | NO | | NULL | |
| view_on_frontend | tinyint(1) | NO | | 0 | |
+------------------+------------+------+-----+---------+----------------+
mysql> describe webforms_results_values;
+--------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+----------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| result_id | int(11) | NO | MUL | NULL | |
| field_id | int(11) | NO | | NULL | |
| value | text | NO | | NULL | |
| rating | int(11) | YES | | NULL | |
| created_time | datetime | YES | | NULL | |
+--------------+----------+------+-----+---------+----------------+
现在我在'results_values'上添加了一个日期时间列'created_time',我想在第二个表上插入日期时间,从相应id的第一个表中复制它们。有什么快速的方法吗?