Co treba takhle:
Kód:
SELECT PID_pracovnik, month(datum), sum(hodin)
FROM hodiny
GROUP BY month(datum), PID_pracovnik
ORDER BY PID_pracovnik;