Users with most comments between two dates

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

;  with users_cte as
(SELECT 
  UserId AS uid, COUNT(Id) AS CountComments
FROM Comments
WHERE (CreationDate >= '##Date1##')
  AND (CreationDate <= '##Date2##')
GROUP BY UserId
)

SELECT TOP(##num##)
  uid AS [User Link], CountComments,
  url = 'site://users/' + CAST(uid AS varchar) + '?tab=activity'  
FROM users_cte
ORDER BY CountComments DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results