MySQL Forums
Forum List  »  Newbie

How to get only one row per person?
Posted by: peter michaux
Date: July 26, 2005 08:21PM

Hi,

I would like to have a table of people and the grades they achieved on a test. They may take the test multiple times. For example

Table: Marks
Fields: Person Grade
A 90
B 62
C 23
C 69
B 81

I'd like to make a query that will list the highest grade each person got. The results would be

Person Grade
A 90
B 81
C 69

Do I need both "order by" and "group by" to do this? If you know the query please give me some hints!

Thanks,
Peter

Options: ReplyQuote


Subject
Written By
Posted
How to get only one row per person?
July 26, 2005 08:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.