Reputation: 2900
I can only explain this with an example.
I have 2 tables (table1
and table2
) which each contain fielda
fieldb
fieldc
and fieldd
.
I want to
UPDATE table2
SET table2.fieldc = table1.fieldc,
table2.fieldd = table1.fieldd
WHERE table2.fielda = table1.fielda
AND table2.fieldb = table1.fieldb
Upvotes: 0
Views: 34
Reputation: 60493
You just miss "table1" declaration
update table2, table1
...
other version
UPDATE table2
JOIN table1
ON table2.fielda = table1.fielda
AND table2.fieldb = table1.fieldb
SET table2.fieldc = table1.fieldc,
table2.fieldd = table1.fieldd
Upvotes: 4