SQL Selecting multiple sums?

后端 未结 5 2088
无人及你
无人及你 2021-02-08 17:00

Let\'s say I have a table:

SELECT  SUM(quantity) AS items_sold_since_date,
        product_ID
FROM    Sales
WHERE order_date >= \'01/01/09\'
GROUP BY product_         


        
5条回答
  •  离开以前
    2021-02-08 17:52

    If you like to see total sales alongside, then you would use sum(sale_amt), and in the group by add the sale_amt. I hope it helps.

提交回复
热议问题