我有一个微软访问查询,它工作正常并给出所需的结果,但我想在底部添加一个总计行
我的查询是
SELECT Product.Description
, Count(Product.PID) AS CountOfPID
, Sum(SalesOrderProduct.NbrItemsDispatched) AS SumOfNbrItemsDispatched
, Sum(SalesOrderProduct.ExtendedPrice)
FROM Product
LEFT JOIN
(
SalesOrder
RIGHT JOIN SalesOrderProduct
ON SalesOrder.SOID = SalesOrderProduct.SOID
)
ON Product.PID = SalesOrderProduct.PID
GROUP BY Product.Description, SalesOrder.Status
HAVING SalesOrder.Status <> 'Open' or SalesOrder.Status is null;
并且在没有数据的情况下,必须显示 0 并且不应该显示 $ 符号