开发者

Calculate Total Value of Products

开发者 https://www.devze.com 2023-03-10 19:29 出处:网络
So I have a table of products. Each product has a price (decimal) and开发者_Python百科 quantity (int).

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号