How to generate Row number in Access?

S

Sadiq

I have a student Table with StudentName and Marks
I want a query which will display the student details with Rank Based on
Marks
 
V

vanderghast

A rank is not a 'row number' since a rank can be derived from the data.


SELECT a.studentName, a.mark, COUNT(*)
FROM tableName AS a INNER JOIN tableName AS b
ON a.mark > b.mark OR (a.mark = b.mark AND a.studentName >=
b.studentName)
ORDER BY a.studentName, a.mark



in sql view. Change tableName (twice) for the real table name.



Vanderghast, Access MVP
 

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

Top