Reputation: 159
How can I make an update of this tables?:
Products table
Transactions table
I want to update the Total quantity finding the Cost in the products table, and multiplying it to my Quantity in my transactions table, but I don't really know how can I do this..
Upvotes: 0
Views: 53
Reputation: 93694
Use Update
from JOIN
syntax
update Transactions A
INNER JOIN Products B
ON A.IdProd = B.IdProd
set A.Total = A.Quantity * B.cost
Upvotes: 1