Reputation: 25745
I have a table order_product
i want to calculate all the values from cost column and quantity column WHERE order_orderNumber = 1100
how do i do it.?
Upvotes: 0
Views: 84
Reputation: 382726
If you meant sum, you can do:
SELECT product_id, SUM(quantity) AS totalQuantity, SUM(cost) AS totalCost
FROM order_product WHERE order_orderNumber = 1100
GROUP BY product_id
Upvotes: 1