codice:
select month(datadoc) as mese, sum(importodoc) as totale
from tabella
group by mese
order by mese