Prova a sostituire :
SUM(H_TIME) AS HANDLE_TIME
di :
MEDIAN(H_TIME) AS HANDLE_TIME
(riga 3)
EDIT:Per i mesi, sostituire:
select
MONTH, WEEK, DAY,
Da:
select
MONTH,
E:
GROUP BY
MONTH
,WEEK
,DAY
Da:
GROUP BY
MONTH
Per le settimane, sostituisci:
select
MONTH, WEEK, DAY,
Da:
select
MONTH, WEEK,
E:
GROUP BY
MONTH
,WEEK
,DAY
Da:
GROUP BY
MONTH
,WEEK