I'm trying to copy several columns from one table to another in MySQL where the ids match. (From 'temp' to 'places')
I'm using the following code:
UPDATE `places` SET `places.wc` = `temp.gen_wc`, `places.cc` = `temp.gen_cc`, `places.gh` = `temp.oth_gh` WHERE `places.id` = `temp.id`;
I get a "Unknown column 'temp.id' in 'where clause'" error even though there is an "id" column in the "temp" table. If I take the tick marks away from that, then I'll get a similar error on another column that exists.
Is there something fundamentally wrong with my statement?