So I have a table of products. Each product has a price (decimal) and开发者_Python百科 quantity (int).
I need to be able to calculate the total price/value of all products in stock. So, multiple each product's price by the quantity and then add them all together.
Wondered if anyone might be able to help me with this.
Thanks.
select sum(price*quantity) as yoursum from yourtable
精彩评论