usa il group by.

codice:
select cognome, count(giornate.idutente) as tot, date_format(data, '%Y%m') as annomese
from risorse
inner join giornate using(idutente)
group by risorse.idutente, annomese
order by ...