Users with most badges of certain kind - with the date of the latest one

1

Please login or register to vote for this query.

(click on this box to dismiss)

Programming Language Design and Implementation

Q&A for designers and implementers of computer programming languages

SELECT TOP(##num?100##)
  RANK() OVER(ORDER BY COUNT(*) DESC) AS Rank,
  b.UserId AS [User Link],
  COUNT(*) AS [Count],
  MAX(b.Date) As [The Most Recent]
FROM Badges b INNER JOIN Users u ON b.UserId=u.Id
  WHERE (b.Name = '##name?Great Answer##')
GROUP BY b.UserId
ORDER BY COUNT(*) DESC, MAX(b.Date) DESC

Enter Parameters

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