I have two columns price and quantity in two different tables product and orders. I want to set the value of a column in orders as price*quantity. I tried the following query but no luck
update orders_
set amount = (select price*quantity
from product,
orders_
where product.productid = orders_.productid);
productid is the common link between the two tables I keep getting the following error:
ERROR 1093 (HY000): You can't specify target table 'orders_' for update in FROM clause