Assign Record Numbers to Records

Reply

Join Date: Jul 2007
Posts: 169
Reputation: tuse is an unknown quantity at this point 
Solved Threads: 14
tuse's Avatar
tuse tuse is offline Offline
Junior Poster

Assign Record Numbers to Records

 
0
  #1
Apr 30th, 2009
In a application for online test, the rank list is computed as follows-
  1. SELECT * FROM test ORDER BY marks DESC

How can we make sure that the first record gets rank1, second rank2 and so on... I want to add the field to the table.

Can this be done using a single pass? As in,a workaround is to create a temp table using the query and then process each record using a script to assign the rank. Is it possible without the script?
Last edited by tuse; Apr 30th, 2009 at 10:28 am.
My blog on .NET- http://dotnet.tekyt.info
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC