UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Ranking in Query With Duplicates    
 
   
joeyjojo
post Jan 5 2005, 06:05 AM
Post #1

UtterAccess Member
Posts: 25



I have a table that stores exam results: ExamResultID, PNUM, ExamID,Result. The table is related to a PupilData: Pupil Info, TGID

I need a query that will rank the results depending on the examID and the TGID. I used the MS example it is giving a rank but against all the results in the table, not just the results of the query
[Result] is the alias given to the tblExamResults in the query
Ranking: (Select Count(*) from tblExamResults Where [Result] >[Results].[Result])+1
Go to the top of the page
 
+
cmv131
post Jan 5 2005, 02:28 PM
Post #2

UtterAccess Addict
Posts: 130



Select ExamID, [Pupil Info], Result
from ExamResults A inner join PupilData B on A.PNum = B.TGID
Order by ExamID, Result desc

Will order them by exam, by result from highest to lowest. I dont know if that is exactly what you are looking for though
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 24th May 2013 - 01:46 AM