我正在尝试替换单个表中的列数据。
有一张“目录\类别\产品”表:
“位置”、“旧位置”、“类别标识”、“产品标识”。
仅当category\u id=9时,我想将“old\u position”替换为“position”:
UPDATE catalog_category_product
SET catalog_category_product.old_position =
(
select position
FROM (select * from catalog_category_product) AS m2
WHERE category_id = 110
)
WHERE category_id = 9`
2条答案
按热度按时间yb3bgrhw1#
它对我有用
8yoxcaq72#
试试这个: