I am attaching an image to make my question clear.

I have defined the sections with respect to year, I want that rows of each year should be added to make one row for each year.
For example for Ano 2009 or year 2009, there will be one row, and all of Mes, S, N, O and Total will be the sum of all rows of 2009. Similarly for 2010 and vice versa, so total there will be 3 rows for three years having Ano, Mes, S, N, O and Total.
I can do it programmaticaly using php, but I want to do it using MySQL SQl query. Can anybody help with it?
1 Answer