SELECT TOP 5 pt.OwnerDisplayName ,AVG(pt.Score) as Avg_Sc...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

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

SELECT TOP 5 pt.OwnerDisplayName
		,AVG(pt.Score) as Avg_Score 
FROM (SELECT *
		FROM(
		SELECT p.OwnerUserId
			  ,p.OwnerDisplayName
			  ,ROW_NUMBER() OVER(PARTITION BY p.OwnerUserId ORDER BY p.Id) as row_num
			FROM Posts p
			) p 
            GROUP BY p.OwnerUserId
			  ,p.OwnerDisplayName
                  ,p.row_num

	)a LEFT JOIN Posts pt ON a.OwnerUserId = pt.OwnerUserId 
			AND a.OwnerDisplayName = pt.OwnerDisplayName
WHERE pt.Title IS NULL
GROUP BY 
pt.OwnerDisplayName
HAVING
    Count(Pt.Id) > 8
ORDER BY 
AVG(pt.Score) DESC

Enter Parameters

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