SELECT RANK() OVER (ORDER BY COUNT(*) DESC) rank, u.Displ...

0

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 
  RANK() OVER (ORDER BY COUNT(*) DESC) rank, 
  u.DisplayName, 
  b.Name,
  COUNT(*)
FROM Badges b
JOIN Users u ON b.UserId = u.Id
GROUP BY u.Id, u.DisplayName, b.Name
ORDER BY COUNT(*) DESC

Enter Parameters

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