. Tables involved:
data_ticket
I try to execute this query:
select t1.fecha_carga, t1.hurtos, t2.fallas, t3.ticket
from (select count(ttc) as hurtos, fecha_carga from data_incidencia
where campo_key_id = 2
group by fecha_carga) t1,
(select count(ttc) as fallas, fecha_carga from data_incidencia
where campo_key_id = 1
group by fecha_carga) t2,
(select count(ticket) as ticket, fecha_solicitud as fecha_carga from data_ticket ) t3 where t1.fecha_carga = t2.fecha_carga;
and the result is as follows:
and the expected is this: