I have the following tables:
Students
id nombre
1 Lucas
Exams
id fecha nota alumno_id
1 25/11/2018 5 1
2 26/11/2018 8 1
I need with a query, to extract the last note of the student according to his date, I have tried:
select alumno_ID , MAX(fecha) from examenes
where alumno_ID = (select id from alumnos)
GROUP BY alumno_ID ;
This brings me a record but I need tb the id of the exam table, what I need is to extract from all students what is their last exam according to the date in the exam table