if
当我尝试获取Items.Iteminfo时,会发生错误。任何人都可以帮助我错了..
答案 0 :(得分:0)
您必须将SELECT列表中的列包含在GROUP BY子句中。
Select PurchasesBody.ItemId,
Items.Iteminfo, Sum(TTLQtyLose) As PurQty,
Avg(PerUnitCost) AS AvgRate, Sum(TTLValue) AS NetValue
From PurchasesBody
left Join Items On PurchasesBody.ItemId=Items.ItemId
Group By PurchasesBody.ItemId,Items.Iteminfo