T-SQL Tuesday #168 : Rank() example


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT TOP (5) Id, DisplayName, Reputation,
  rk = RANK() OVER (ORDER BY Reputation DESC)
  FROM dbo.Users
  ORDER BY Reputation DESC;

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results