开发者

Calculate Total Value of Products

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜