[thelist] ranking entries in a database

Alastair Murdoch alastair at cubeit.co.uk
Mon May 13 18:39:06 CDT 2002


OK, I've got a question.

I'm putting together a little web-based app which stores bike-race results.
What I want to do is be able to allow each rider to enter their race number
and obtain a personal set of results for the season so far. This part I can
do.

What I'd like to do now is extend it so that in each *riders* profile they
can see what *position* (1st, 2nd, 55th...) they came out of their category.
Also I'd like to produce a leaderboard, showing the current points table,
which is also dependant on the riders position for each round (within their
own category)

Now I could store the position off the timesheet and be done with it, but
I'd rather not since:

a) I'm sure I read that its bad practice to store values that could be
calculated
b) The timesheets have a nasty habit of being wrong (meaning lots of manual
correction)
c) I'd like to know how to do this for future reference...

So my question is, how do I calculate the rank of each rider?? Is this and
SQL problem or an ASP one??

Anybody point me in the right direction

cheers

alastair

================
Additional info.

I'm using ASP and Access (SQL server may be available)

Rider Numbers are unique throughout the series

basic db table structure:

tblRound
--------
roundID(pk)
roundName
etc.

tblRaceCategory
---------------
categoryID(pk)
categoryName

tblRaceResults
--------------
roundID(fk)
categoryID(fk)
time
riderNumber





More information about the thelist mailing list