0
I have a class table and a table of parents. A student may be associated with up to three parents.
SELECT
a.idAluno,
a.matriculaAluno,
a.nomeAluno,
a.sexoAluno,
a.dataNascAluno,
b.id,
b.matricula,
b.cpf,
b.nome
FROM
alunos a
LEFT JOIN matriculas b
ON a.matriculaAluno = b.matricula
WHERE
a.status = 1 AND b.status = 1
GROUP by
b.cpf
The return is : I would like the same records from the first table not to be repeated. And I want the matriculation table to come in the grouped survey.
That is, for each student record come grouped the three records of responsible, because each student can have 3 responsible at most.