Users with highst number of combined Views

0

Please login or register to vote for this query.

(click on this box to dismiss)

Returns the Users with the highest number of total views for their questions

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

-- Users with highst number of combined Views
-- Returns the Users with the highest number of total views for their questions
SELECT 
  Users.Id AS [User Link],
  Sum(ViewCount) AS TotalViews,
  Count(*) AS NumberOfQuestions,
  Sum(ViewCount)/Count(*) AS AvgViewsPerQuestion 
FROM Posts 
INNER JOIN Users ON Users.Id = Posts.OwnerUserId 
WHERE PostTypeId = 1 
GROUP BY Users.Id 
ORDER BY TotalViews DESC

Enter Parameters

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