sum total in a query with group by used
Posted: Fri Jun 17, 2005 3:26 am
I have the following query:
Is there a way to find the sum total of "refer" using the same query?
At present i'm pulling out all a count of "refers" grouped together in sets, but i also need an overall count of those found in the above query.
Code: Select all
$ref2 = "SELECT DATE_FORMAT(dateadded, '%d-%m-%Y') AS dateadded,COUNT(refer) AS refno,refer,status FROM orders $filter $date GROUP BY refer ORDER BY refno DESC";At present i'm pulling out all a count of "refers" grouped together in sets, but i also need an overall count of those found in the above query.