-1
SELECT SUM(DISCIPLINA.VALOR) + MATRICULA.VALOR
FROM ALUNO, MATRICULA, MATDISCIPLINA, DISCIPLINA, SEMESTRE
WHERE ALUNO.CDALUNO = MATRICULA.CDALUNO
AND MATRICULA.CDSEMESTRE = SEMESTRE.CDSEMESTRE
AND MATRICULA.CDMATRICULA = MATDISCIPLINA.CDMATRICULA
AND MATDISCIPLINA.CDDISCIPLINA = DISCIPLINA.CDDISCIPLINA
AND SEMESTRE.ANO = '2018.1'
GROUP BY ALUNO.NOME
Have you tried placing SELECT values between the
max()
? , more or less like this:SELECT max(SUM(DISCIPLINA.VALOR) + MATRICULA.VALOR)
?– Leo
Already tried mysql returns this error: ERROR 1111 (HY000): Invalid use of group Function
– Hiago Pais
Use: SUM(DISCIPLINA.VALOR) + SUM(MATRICULA.VALOR)
– anonimo