I'm using this command in sqlserver:
SELECT ALUNOS.NOME, DISCIPLINAS.NOME AS DISCIPLINA, MAX(NOTAS.NOTA) AS MEDIA FROM NOTAS
INNER JOIN ALUNO_DISCIPLINA ON ALUNO_DISCIPLINA.identificacao = NOTAS.codAlunoDisciplina
INNER JOIN DISCIPLINAS ON ALUNO_DISCIPLINA.CODIGO_DISCIPLINA = DISCIPLINAS.CODIGO
INNER JOIN ALUNOS ON ALUNO_DISCIPLINA.registro_aluno = ALUNOS.Registro
GROUP BY DISCIPLINAS.NOME,ALUNOS.NOME
ORDER BY DISCIPLINAS.NOME
Then the result generates the following table according to the image
I would like you to show only (MARIA geography 9.00) and (JOÃO portugues 10,00), which are the highest grades of students, ie compare between Portuguese and show the highest grade tbm. Any suggestions where I'm wrong ??