1UPDATE t1
2LEFT JOIN
3 t2
4ON t2.id = t1.id
5SET t1.col1 = newvalue
6WHERE t2.id IS NULL
1UPDATE t1
2SET t1.COL1 = t2.COL1, t1.COL2 = t2.COL2
3FROM MY_TABLE AS t1
4INNER JOIN MY_OTHER_TABLE AS t2 ON t1.COLID = t2.ID
5WHERE t1.COL3 = 'OK';
1UPDATE tableB
2INNER JOIN tableA ON tableB.name = tableA.name
3SET tableB.value = IF(tableA.value > 0, tableA.value, tableB.value)
4WHERE tableA.name = 'Joe'
5
1UPDATE TableB
2SET TableB.value = (
3 SELECT TableA.value
4 FROM TableA
5 WHERE TableA.name = TableB.name
6);
1UPDATE MY_TABLE AS t1
2INNER JOIN MY_OTHER_TABLE AS t2 ON t1.COLID = t2.COLID
3SET t1.COL1 = t2.COL1, t1.COL2 = t2.COL2
4WHERE t1.COL3 = 'OK';