I have two tables (answers and answer_points) related by response_id. There are answers that do not have punctuation. I need to get all the answers with your average scores. I use this query:
SELECT 'respuestas'.'id_respuesta', 'respuestas'.'texto', 'respuestas'.'fecha', 'respuestas'.'nombre', AVG('punt_respuestas'.'puntuacion') FROM 'respuestas' LEFT JOIN 'punt_respuestas' ON 'respuestas'.'id_respuesta' = 'punt_respuestas'.'id_respuesta'
But this only returns me the answers that have punctuation. I need those that do not have it, take it as 0.