Is it possible to do an update on one table, with a selection across 2 tables, or does one first have to query a table, then iterate through the rows doing an update on the other table per line (which seems v inefficient)?
I want to say something like
UPDATE table1, table2 SET table1.val = table1.val + 1 WHERE table1.userID = table2.userID AND table1.otherVal = table2.otherVal
is this possible? or do I have to SELECT from table2, and then iterate through the resultset updating table1?
I want to say something like
UPDATE table1, table2 SET table1.val = table1.val + 1 WHERE table1.userID = table2.userID AND table1.otherVal = table2.otherVal
is this possible? or do I have to SELECT from table2, and then iterate through the resultset updating table1?