tags:

views:

33

answers:

1

I'm doing it this way,but get an error:

mysql> update products set products_image=(select products_image from products where products_id=2) where products_id=3;
ERROR 1093 (HY000): You can't specify target table 'products' for update in FROM clause
+4  A: 
UPDATE products p1, products p2 
SET p1.products_image=p2.products_image 
WHERE p1.id=3 AND p2.id=2;
Adam Bernier