Users with most posts between two dates

1

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

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

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

Enter Parameters

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