1

我是这样做的:

UPDATE products 
   SET products_image = (SELECT products_image 
                           FROM products 
                          WHERE products_id = 2) 
 WHERE products_id = 3;

...但得到一个错误:

ERROR 1093 (HY000): 您不能在 FROM 子句中指定目标表 'products' 进行更新

4

1 回答 1

5
UPDATE products p1, products p2 
SET p1.products_image=p2.products_image 
WHERE p1.id=3 AND p2.id=2;
于 2010-05-22T04:09:27.170 回答