Greetings I need to group records per hour in a range (from 7 to 16) in mysql but I also need to show the hours where there is no record if there was at 7, 8, 9 but at 10 there are no records I need to leave the time and maybe a zero if there are null results
For example I have this query
select HOUR(created_at) as hora, asunto as name, COUNT(turno) as numero from tikets
where estado = 1 and id_sucursal = 1
and asunto = 'Factibilidad'
and DATE(created_at) = '2017-06-14'
GROUP BY hora ASC
that throws me this:
and I take care that I throw something like that
Some idea of how I could raise it if I need another table or how I could do the selection would be appreciated