Hi all,
I have the following issue that is causing me a headache for more than a week now. I need to rank the below entries:
I have Table A incl the first two colums below(Name; Score) - I need to get column 3 in my result:
Name Score Best
Inna 2 1st best
Inna 4 2nd best
Luca 7 1st best
The idea is to compare the score for each name and the lowest score gets the 1st best, 2nd lowest – 2nd best and like that till 4th best. I thought using the below, but get a different outcome that the desired?
SELECT (SELECT COUNT(*) FROM [Table A] WHERE Score >= s.Score) AS Rank, s.Name, s.Score,
FROM [Table A] AS s
ORDER BY s.Score;
Any thought will be more than welcome.
Thx all
I have the following issue that is causing me a headache for more than a week now. I need to rank the below entries:
I have Table A incl the first two colums below(Name; Score) - I need to get column 3 in my result:
Name Score Best
Inna 2 1st best
Inna 4 2nd best
Luca 7 1st best
The idea is to compare the score for each name and the lowest score gets the 1st best, 2nd lowest – 2nd best and like that till 4th best. I thought using the below, but get a different outcome that the desired?
SELECT (SELECT COUNT(*) FROM [Table A] WHERE Score >= s.Score) AS Rank, s.Name, s.Score,
FROM [Table A] AS s
ORDER BY s.Score;
Any thought will be more than welcome.
Thx all