Problem: - Take the lines that have equal years through the command in mysql.
Query that I'm using:
SELECT produtividade, ano
FROM area_e_producao_05_15
INNER JOIN dados_cidades
ON edr_id={$edr['edr_id']}
WHERE area_e_producao_05_15.id_municipio=dados_cidades.dados_cidades_id AND Ano BETWEEN {$ano} and {$ano2} Order By Ano
My result was:
In this case the result was little, but in some cases many years are created equal. Is there any way to add these productivities and present a line with each year? Example of the photo the expected result is:
Productivity | Year 50 | 2010 50 | 2011