This previous questions almost has my answer: How to update from select with a Join
That questions solution was:
UPDATE invoiceLine
INNER JOIN terminal
ON invoiceLine.ctn = terminal.ctn
INNER JOIN network
ON terminal.network = network.id
SET invoiceLine.network = network.label
What I am truly trying to do is combine(permanently store Table2's data in Table1) two tables that share a common primary key. Table1 has 49 fields while Table2 has 104 fields.
What if I want to update over 100 fields?
Do I need to SET invoiceLine.network = network.label, invoiceLine.item1 = network.item1, etc... all the way to invoiceLine.item103 = network.item103?
Is there an easier way to JOIN two tables AND set it in the database?
SELECT *
FROM test2
INNER JOIN test1 ON test1.`API_ID` = test2.`API_ID`
This does what I want, except it doesn't SET the data in test1.