这是我的查询。我想做金额的总和......但我没有得到如何得到全额的总和。请帮帮我。
SELECT AllocateAsset.Item, AllocateAsset.ItemModel,
COUNT(AllocateAsset.ItemModel) AS CountOfItem,
(CountOfItem * (
SELECT Rate
FROM rateList
WHERE rateList.MakeModel = AllocateAsset.ItemModel
)
) / 4 AS Amount , SUM(Amount) AS Total
FROM aboutPM INNER JOIN
(
AllocateAsset INNER JOIN PMReport
ON AllocateAsset.ID=PMReport.AssetID
)
ON aboutPM.ID = PMReport.AboutPMID
WHERE (((aboutPM.Year)="2015") AND ((aboutPM.Period)="Jan-Feb-Mar"))
GROUP BY AllocateAsset.Item, AllocateAsset.ItemModel, CountOfItem, Amount
ORDER BY AllocateAsset.Item
答案 0 :(得分:0)
从Group by
列表
GROUP BY AllocateAsset.Item, AllocateAsset.ItemModel, CountOfItem, Amount