我这样做:
UPDATE products
SET products_image = (SELECT products_image
FROM products
WHERE products_id = 2)
WHERE products_id = 3;
...但收到错误:
ERROR 1093(HY000):您无法在FROM子句中指定要更新的目标表'产品'
答案 0 :(得分:5)
UPDATE products p1, products p2
SET p1.products_image=p2.products_image
WHERE p1.id=3 AND p2.id=2;