mysql update table from another table
UPDATE tableB
INNER JOIN tableA ON tableB.name = tableA.name
SET tableB.value = IF(tableA.value > 0, tableA.value, tableB.value)
WHERE tableA.name = 'Joe'
mysql update table from another table
UPDATE tableB
INNER JOIN tableA ON tableB.name = tableA.name
SET tableB.value = IF(tableA.value > 0, tableA.value, tableB.value)
WHERE tableA.name = 'Joe'
mysql update column with value from another table
/* Update products position by it's brand's position (from options table)
with Considering the languages */
UPDATE products
INNER JOIN options ON products.brand = options.value
SET products.brand_position = IF(options.lang = products.lang, options.position, products.brand_position)
WHERE options.name = 'pro_brand';
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us