MySQL – Update one table from another

If you need to update one table with information from another table, you can use next query.

UPDATE sourceTable s, destTable d
SET d.something = s.something
WHERE d.fieldId = s.id

Leave a Reply

Your email address will not be published. Required fields are marked *