您好我想问一下我的工作
select * from
(Select m.Brand,u.Color,Count(Unit)as [Total unit]
from Brands m
inner join Products u on m.BrandID=u.ProductID
Group by m.Brand ,u.Color
with cube
)as Pvt
PIVOT ( Sum([total unit])
For Color IN ( [Black],[White],[Gray],[Silver],[Orange],[Dark Blue] )
)AS Pivot_Table
我想显示品牌总数和总颜色,但此代码只计算每种颜色并计算每个品牌的每种颜色
我如何获得总品牌和总颜色?