MrTV
asked on
Mysql sate ment deduct onetable from another table
I have 2 tables table 'product' and 'sale' how can I write sql statement to deduct sale item from table product
You have to Join the two tables first , so we need to know what is your joint field , if you can please post the schema for the two tables and just provide an example for what you want to do exactly
ASKER
update product,sale set produt = ( product.ProductQuantity - sale.quantity)
I try like this but it not work
I try like this but it not work
So you have two tables one called products and it has a field called produt and another once called ProductQuantity
and you have another table called sales and it has a filed called produt and another filed called quantity
is that true ?
and you have another table called sales and it has a filed called produt and another filed called quantity
is that true ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.