MYSQL - SUM of a column based on common value in other column

前端 未结 3 1999
日久生厌
日久生厌 2021-01-29 01:52

I\'m stuck on crafting a MySQL query to solve a problem. I\'m trying to iterate through a list of \"sales\" where I\'m trying to sort the Customer IDs listed by their total accu

3条回答
  •  自闭症患者
    2021-01-29 01:58

    Select CustomerID, sum(PurchasePrice) as PurchaseTotal FROM sales GROUP BY CustomerID ORDER BY PurchaseTotal ASC;

提交回复
热议问题