0
I have the following sql statement:
SELECT a.alunonome AS aluno,
m.materianome AS disciplina,
AVG(CASE n.notabimestre
WHEN 1 THEN n.nota
ELSE null
END) AS bim1,
AVG(CASE n.notabimestre
WHEN 2 THEN n.nota
ELSE null
END) AS bim2,
AVG(CASE n.notabimestre
WHEN 3 THEN n.nota
ELSE null
END) AS bim3,
AVG(CASE n.notabimestre
WHEN 4 THEN n.nota
ELSE null
END) AS bim4
FROM notas n
INNER JOIN materias m ON m.materiaid = n.materiaid
INNER JOIN alunos a ON a.alunoid = n.alunoid
GROUP BY n.materiaid, n.alunoid, a.alunonome, m.materianome
he returns me:
How do I concatenate the id of the note getting like this:
ALUNO |DISCIPLINA |id1|bim1|id2|bim2|id3|bim3|id4|bim4
GUSTAVO |BANCO DE DADOS |1 |7 |2 |7 |3 |7 |4 |8
Note id and in front note do this for the 4 bimonthes. Thanks in advance!
You see, the two-month note field can be composed of more than one record. You would like to show all?
– Sorack
wanted to show everyone
– Smoke Rohden