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
1/* Update products position by it's brand's position (from options table)
2with Considering the languages */
3UPDATE products
4INNER JOIN options ON products.brand = options.value
5SET products.brand_position = IF(options.lang = products.lang, options.position, products.brand_position)
6WHERE options.name = 'pro_brand';