the structure of my tables are
not all the questions have opc_multiples and the multiple options are linked to the corresponding questions and I show them with the following query
SELECT opc_multiples.id_pregunta,group_concat(opc_multiples.opciones order by opc_multiples.opciones asc) AS Opciones from opc_multiples,preguntas where preguntas.id_tipo_respuesta = 3 and opc_multiples.id_pregunta = preguntas.id group by opc_multiples.id_pregunta ;
and it shows me the following
What I need and I have not been able to obtain is to show all the questions, whether they are multiple choice or not, and if they are to show the AS Options and when they are not null, it is with a join but I cannot do it
This is an example:
As they mention in the comments, you must use a left join so that even if the corresponding record does not exist in the multiple options table, it returns the null you need. Check the columns and the order of the tables well. The query would be:
And this is the result:
Here you have the fiddle to practice.