vendredi 30 janvier 2015

How to get best mark for each Student


I can't find a solution although it should be easy one.


I have some students and all I need is to get the highest mark of each one in Math.



TableName: Students.
Columns:
Name Mark
John 90
John 84
John 92
John 60
Yan 75
Yan 88
Yan 60


I want to get this results:



Name Mark
John 92
Yan 88


I have tried to do top 1, but it gives me only one student. I need to do somehow top 1 on each student, but I don't know how to do that.


Please help me to figure it out.


Thanks in advance.





Aucun commentaire:

Enregistrer un commentaire