I am trying to write a SQL statement to return the latest record for each subject for a person,
Database
Counter,Name,Subject,Grade
1,PersonA,Maths,C
2,PersonB,Maths,B
3,PersonA,English,B
4,PersonB,English,A
5,PersonA,Maths,A
6,PersonB,Maths,B
I would like to return that latest result for PersonA
5,PersonA,Maths,A
3,PersonA,English,B
How would this be achieved?
1 Answer