How to put two records from one table in another as a single MySql select bank?
SELECT TURMA.turma_id, TURMA.turma_nome, PROF.prof_name
from turma TURMA LEFT JOIN professor_materia PROF_MAT
ON TURMA.turma_id=PROF_MAT.prom_mat LEFT JOIN professor PROF
ON PROF_MAT.prom_prof=PROF.prof_id
I would like it to return like this:
turma_id | turma_nome | prof_name
1 | 1º ANO A | PROFESSOR DE MATEMATICA, DANIEL
2 | 2º ANO | NULL
Thank you in advance.