codice:
SELECT nome, data, time_format(sum(timediff(STR_TO_DATE(ora_fine,'%H:%i'), STR_TO_DATE(ora_inizio,'%H:%i'))), '%H:%i') as totale_ore FROM tabella  GROUP BY nome, data ORDER BY nome, data