SQL Server: position based on marks
- by Rhys
I am using SQL Server 2008. I have a Student table in which there are following fields:
1. StudentId, 2. StudentName, 3. Marks .
I want to get a resultset in which there should be a column named “Position”. Something like “Select StudentId,StudentName,Marks, as Position from Student...” so that, depending on the marks a student scored, i can evaluate them as the 1st, 2nd or 20th position. If students have the same marks, then they have the same position.
Thanks.
Rhys