I have a product sales table with fields sales_id , date and product . This query:
SELECT DAYOFYEAR(fecha),COUNT(*) as con FROM ventas WHERE YEAR(fecha)=2016 GROUP BY DAYOFYEAR(fecha)
I get the following result:
DAYOFYEAR(fecha) con 1 4 2 5 3 2 4 1 5 1 6 4
The question is: What would be the SQL query so that the result is as follows?
DAYOFYEAR(fecha) con 1 4 2 9 3 11 4 12 5 13 6 17
I mean how to accumulate the results that are coming out in the COUNT?
Thank you very much.