with answercounts as ( select count(*) as answercount fro...

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 answercounts as (
  select count(*) as answercount
  from posts
  where parentid is not NULL
  group by parentid
  having count(*) > 0
)
SELECT
    answercount, COUNT(answercount), 
    PERCENT_RANK() OVER (ORDER BY answercount) AS Percent_Rank
from answercounts
GROUP BY answercount
order by percent_rank

Enter Parameters

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