Editado una vez nos has pasadoBueno y ya para acabar de rizar el rizo esta seria la tabla real que estás usandoconsulta para ver las llamadas por franjas de media hora desde las 8. Espero te sea útil!00 hasta las 18.00:
SELECT
SUM(if(HOUR(T.TIME_CONTACT) = 8 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_8_00,
SUM(if(HOUR(T.TIME_CONTACT) = 8 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_8_30,
SUM(if(HOUR(T.TIME_CONTACT) = 9 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_9_00,
SUM(if(HOUR(T.TIME_CONTACT) = 9 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_9_30,
SUM(if(HOUR(T.TIME_CONTACT) = 10 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_10_00,
SUM(if(HOUR(T.TIME_CONTACT) = 10 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_10_30,
SUM(if(HOUR(T.TIME_CONTACT) = 11 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_11_00,
SUM(if(HOUR(T.TIME_CONTACT) = 11 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_11_30,
SUM(if(HOUR(T.TIME_CONTACT) = 12 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_12_00,
SUM(if(HOUR(T.TIME_CONTACT) = 12 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_12_30,
SUM(if(HOUR(T.TIME_CONTACT) = 13 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_13_00,
SUM(if(HOUR(T.TIME_CONTACT) = 13 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_13_30,
SUM(if(HOUR(T.TIME_CONTACT) = 14 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_14_00,
SUM(if(HOUR(T.TIME_CONTACT) = 14 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_14_30,
SUM(if(HOUR(T.TIME_CONTACT) = 15 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_15_00,
SUM(if(HOUR(T.TIME_CONTACT) = 15 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_15_30,
SUM(if(HOUR(T.TIME_CONTACT) = 16 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_16_00,
SUM(if(HOUR(T.TIME_CONTACT) = 16 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_16_30,
SUM(if(HOUR(T.TIME_CONTACT) = 17 and MINUTE(T.TIME_CONTACT) >= 0 and MINUTE(T.TIME_CONTACT) <= 29, 1, 0)) AS FRANJA_17_00,
SUM(if(HOUR(T.TIME_CONTACT) = 17 and MINUTE(T.TIME_CONTACT) >= 30 and MINUTE(T.TIME_CONTACT) <= 59, 1, 0)) AS FRANJA_17_30
FROM DIFERIDAS T;