mysql update table based on values from another table code example
Example 1: update table from another table mysql
UPDATE t1
SET t1.COL1 = t2.COL1, t1.COL2 = t2.COL2
FROM my_table AS t1
INNER JOIN my_other_table AS t2 ON t1.COLID = t2.ID
WHERE t1.COL3 = 'OK';
Example 2: mysql update table from select on another table
UPDATE TableB
SET TableB.value = (
SELECT TableA.value
FROM TableA
WHERE TableA.name = TableB.name
);