📅  最后修改于: 2022-03-11 15:04:57.435000             🧑  作者: Mango
/* 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';