I have a test results table that looks like this

student_id      test_id         score
1               1               90
1               1               100
1               1               80

2               1               95
2               1               85
2               1               75

I need to create a query that would give me the average of the top 2 scores
per student per test. 
Following this example, student #1 would have an average of 95 (100 + 90)/2
for test #1 and student #2 would have an average of 90 (95 + 85)/2

BTW, I using mysql 3.23

Any ideas on how I can do this?

thanks,

Luis

Reply via email to