loadDashboardItems
但显示此错误
Msg 8120,Level 16,State 1,Line 1 专栏' Customer.CustomerName'在选择列表中无效,因为它不包含在聚合函数或GROUP BY子句中。
答案 0 :(得分:1)
您忘记指定group by子句,请尝试:
Select c.CustomerName, pl.ProductName as 'Product Name', o.OrderDate as 'Order date',
Count([Address]) as 'No of Places', SUM(pl.Price * od.OrderQty) as 'Total Amount'
From Customer c
Inner Join [Order] o ON o.CustomerId = c.CustomerID
Inner Join OrderDetails od ON od.OrderId = o.OrderID
Inner Join ProductList pl ON pl.ProductID = od.ProductId
Inner join Customer cc on c.CustomerID=cc.CustomerID and cc.CustomerName = 'Mr.A'
group by c.CustomerName, pl.ProductName, o.OrderDate