codice:
select `data`, ido,
sum(inviati) as tot_inv,sum(ricevuti) as tot_ric
from tabella
group by ido