Insert line into a query result (sum)

后端 未结 3 1995
不思量自难忘°
不思量自难忘° 2021-01-05 20:59

I have a report that shows products that customers have ordered, along with their prices:

CompanyA    Product 7    14.99  
CompanyA    Product 3    45.95
Com         


        
3条回答
  •  情话喂你
    2021-01-05 21:53

    SELECT  company,
            product,
            SUM(price)
    FROM    companyMaster
    GROUP BY
            company, ROLLUP(product)
    

提交回复
热议问题