Users with highest average viewcount of their questions

1

Please login or register to vote for this query.

(click on this box to dismiss)

The Great Outdoors

Q&A for people who love being outdoors enjoying nature and wilderness, and learning about the required skills and equipment

SELECT TOP(##num?500##)
  RANK() OVER (ORDER BY AVG(CAST(p.ViewCount AS decimal)) DESC) AS [Rank],
  p.OwnerUserId AS [User Link], p.OwnerDisplayName,
  AVG(CAST(p.ViewCount AS decimal)) AS [Average ViewCount],
  SUM(p.ViewCount) AS [Total Views],
  SUM(Case When p.CommunityOwnedDate IS NULL Then p.ViewCount Else 0 End) AS [NonCW Views],
  COUNT(p.Id) AS [Count],
  SUM(Case When p.CommunityOwnedDate IS NULL Then 1 Else 0 End) AS [NonCW Count]
FROM Posts p
WHERE p.PostTypeId=1
GROUP BY p.OwnerUserId, p.OwnerDisplayName
HAVING (COUNT(p.Id)>=##min?10##)
ORDER BY AVG(CAST(p.ViewCount AS decimal)) DESC

Enter Parameters

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