Think my problem is I am trying to sum a count in the same query, could this be achieved in php to avoid this? The Records column displays count of records while the Costs sums the costs, this works great but I would like to then peform a sum of both these columns to show a grand total?
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
Use
With RollUpat last. Single time scanning of table, so it’s performance oriented.Refer here for more details