I have a query result as attached
I want to sum the column value as per the month and year display in column 1 as per the attached image in the below table column 1 show dec-2014 in column 1 and the sum of all value of colum2 till this month and year.
You should use GROUP BY column1
then SUM the column2
EDIT :
Asumming your table name is
date_test
SQL :
SELECT MONTHNAME(column1) as month, YEAR(column1) as years , SUM(column2) FROM `date_test` GROUP BY month , years
You can see we alias the month and year and use it for the GROUP BY
You can change the name of the table or concat the aliased date to fit your format as Dec 2014