How did you calculate rank=7 for the threes's? Given that you have eight three's, I can see the rank being 3, or the rank being 10. Can you explain the logic used to get 7?
If you want to assign rank=3 to the three's (which is what usually people do):SELECT *,
RANK() OVER(ORDER BY col1) as [Rank]
FROM YourTable;
If you want to assign rank as 10 to the three's:SELECT *,
RANK() OVER(ORDER BY col1) + COUNT(*) OVER(PARTITION BY col1) -1
FROM YourTable