Question percentile by view and votes on its accepted answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with ViewsScores as (
select Q.Id, Q.ViewCount, A.Score
from Posts as Q, Posts as A
where Q.AcceptedAnswerId = A.Id 
  and Q.Id = A.ParentId
  and Q.PostTypeId = 1
  and A.PostTypeId = 2
)
,AllViewsScores as (
select AllCount = COUNT(*)
from ViewsScores
)
,TopViewsScores as (
select Count = COUNT(*)
from ViewsScores
where ViewCount > ##ViewCount?13409##
  and Score > ##AcceptedAnswerScore?20##
) 
SELECT 100*CAST(Count AS decimal(20, 5)) / (SELECT AllCount FROM AllViewsScores) AS Percentile
FROM TopViewsScores

Enter Parameters

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