How can I do three table JOINs in an UPDATE query?
The answer is yes, you can.
Try it like this:
UPDATE TABLE_A a JOIN TABLE_B b ON a.join_col = b.join_col AND a.column_a = b.column_b JOIN TABLE_C c ON [condition]SET a.column_c = a.column_c + 1
For a general update join:
UPDATE TABLEA aJOIN TABLEB b ON a.join_colA = b.join_colBSET a.columnToUpdate = [something]
An alternative way of achieving the same result is not to use the JOIN
keyword at all.
UPDATE TABLE_A, TABLE_BSET TABLE_A.column_c = TABLE_B.column_c + 1WHERE TABLE_A.join_col = TABLE_B.join_col