Dear,
CREATE TABLE 'preguntas' (
'id_pregunta' int(11) NOT NULL,
'nombre' varchar(200) COLLATE utf8_spanish_ci NOT NULL,
'id_dimension_p' int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
CREATE TABLE 'respuesta' (
'id_respuesta' int(11) NOT NULL,
'tipo_respuesta' set('1','2','3','4','5') COLLATE utf8_spanish_ci NOT NULL,
'id_pregunta_r' int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
I have this query
SELECT preguntas.id_pregunta,respuesta.tipo_respuesta,
sum(IF (respuesta.tipo_respuesta is null ,0,1)) AS total_com
FROM preguntas
LEFT JOIN respuesta
ON preguntas.id_pregunta=respuesta.id_pregunta_r
GROUP BY preguntas.id_pregunta,respuesta.tipo_respuesta
What should be thrown
I have to show the nulls to be able to graph any help or guidance will be appreciated