4
I have two queries that work perfectly separately, but I needed all their records together.
Would be these:
SELECT b.idBanca AS idB, b.DataHora AS dataHora,
b.Sala AS sala, t.idTrabalho AS idT,
p.Nome AS orientador, a.Nome AS aluno, t.Nome AS trabalho
FROM Bancas b
INNER JOIN Trabalhos t ON t.idTrabalho = b.idTrabalho
INNER JOIN Professores p ON t.idProfessor = p.idProfessor
INNER JOIN Alunos a ON t.idAluno = a.idAluno
INNER JOIN ProfessoresBancas pb ON b.idBanca = pb.idBanca
WHERE t.idSemestre = '$idSemestre' AND pb.idProfessor = '$idProfessor'
ORDER BY dataHora
and
SELECT b.idBanca AS idB, b.DataHora AS dataHora,
b.Sala AS sala, t.idTrabalho AS idT,
p.Nome AS orientador, a.Nome AS aluno, t.Nome AS trabalho
FROM Bancas b
INNER JOIN Trabalhos t ON t.idTrabalho = b.idTrabalho
INNER JOIN Professores p ON t.idProfessor = p.idProfessor
INNER JOIN Alunos a ON t.idAluno = a.idAluno
INNER JOIN ProfessoresBancas pb ON b.idBanca = pb.idBanca
WHERE t.idSemestre = '$idSemestre' AND p.idProfessor = '$idProfessor'
ORDER BY dataHora
Only what changes is the $idProfessor
WHERE... I need the records of the two within the same array arriving in PHP... I tried with UNION, with SELECT chained and nothing... Would anyone know any alternative?
Very interesting.
– Lollipop
And there are still many techniques that cover programming, mainly the form of interpretation of each language, most standardize the same concepts and logical principles.
– Corvo