认为我的问题是我试图在同一个查询中求和一个计数,这可以在 php 中实现以避免这种情况吗?Records 列显示记录数,而 Costs 对成本求和,这很好用,但我想然后对这两个列进行求和以显示总计?
Select
tblcontacts.ContactFullName As Name,
Count(tblcases.CaseID)As Records,
Sum(tblcases.CaseCommission) As Costs
From
tblcontacts Inner Join
tblcases On tblcontacts.ContactID =
tblcases.ContactAssignedTo
Group By
tblcontacts.ContactFullName