Allocating 1st, 2nd, 3rd etc

  • Thread starter Thread starter Peter Mitchell
  • Start date Start date
P

Peter Mitchell

Having sorted records how do I allocated the
top score position 1
second position 2
third position 3
etc

the purpose could be students exam results for example

Hope someone can help, please.

Peter
 
Try this --
SELECT T.Column1, T.Column2, (SELECT COUNT(*)
FROM [YourTable-4] T1
WHERE T1.Column2 <= T.Column2) AS Rank
FROM [YourTable-4] AS T
ORDER BY T.Column2;

If there are two the same it give both the higher rank.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top