S
Steve S
I have a subquery that ranks test scores correctly until there is a
duplicate. How can I modify the query to get the results I need? I got the
subquery code from a post last October. This is a great resource.
Table1 Results What I want
Score Rank Score rank Score Rank
68.4 78.4 1 78.4 1
46.6 73.4 2 73.4 2
34.0 70.0 3 70.0 3
78.4 68.4 5 68.4 4 <-- Want 4
twice
68.4 68.4 5 68.4 4 <-- and skip 5
70.0 57.8 6 57.8 6
57.8 46.6 7 46.6 7
73.4 34.0 8 34.0 8
SELECT Table1.Score, (select count(*) from [Table1] as x where x.score >=
[table1.score]) AS Rank
FROM Table1
ORDER BY Table1.Score DESC;
Thanks for any help
duplicate. How can I modify the query to get the results I need? I got the
subquery code from a post last October. This is a great resource.
Table1 Results What I want
Score Rank Score rank Score Rank
68.4 78.4 1 78.4 1
46.6 73.4 2 73.4 2
34.0 70.0 3 70.0 3
78.4 68.4 5 68.4 4 <-- Want 4
twice
68.4 68.4 5 68.4 4 <-- and skip 5
70.0 57.8 6 57.8 6
57.8 46.6 7 46.6 7
73.4 34.0 8 34.0 8
SELECT Table1.Score, (select count(*) from [Table1] as x where x.score >=
[table1.score]) AS Rank
FROM Table1
ORDER BY Table1.Score DESC;
Thanks for any help