1
所以我有這兩個表。更新表與ID匹配的另一個表的數據
table1
+----+---------+
| id | type_id |
+----+---------+
| 1 | 1 |
+----+---------+
| 2 | 12 |
+----+---------+
table2
+----+-----------+---------+
| id | table1_id | type_id |
+----+-----------+---------+
| 5 | 1 | 0 |
+----+-----------+---------+
| 6 | 2 | 0 |
+----+-----------+---------+
我想用table1.type_id中的值更新table2.type_id,使用table1中的id作爲參考點。
我無法將我的大腦圍繞如何做到這一點。