Hello all,
I have this query so far:
SELECT SUM(t1.totalprice) as totalprice,
SUM(t1.sales) as sales, t1.`year` as `year`,
t1.mnth as `month`
from
(SELECT
Sum(crm_sales.totalprice) AS totalprice,
MONTHNAME(crm_sales.date) AS mnth,
YEAR(crm_sales.date) AS `year`,
Count(crm_sales.totalprice) AS sales,
MONTH(crm_sales.date) AS `ordering`
FROM `crm_sales`
WHERE `date` BETWEEN '2009-01-01' AND '2010-05-28'
GROUP BY crm_sales.date
) as t1
GROUP BY t1.`year`,t1.mnth
ORDER BY t1.`year`, t1.ordering
I need all these fields but also the sum of the sum of the field indicated:
SUM(t1.totalprice) as totalprice
SUM(t1.sales) as sales <------------ SUm of this sum
t1.`year` as `year`
t1.mnth as `month`
Any ideas?