Jetzt mal ohne die Tabelle zu kennen in etwa so

PHP-Code:
Select AuftragAbteilungSum(Arbeitszeit)
from MyFile
group by Auftrag
Abteilung
order by Auftrag
Abteilung 
Gruß
Ronald