tuse 22 Junior Poster

In a application for online test, the rank list is computed as follows-

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.