Gieco Max Number of Posts have the exact same number of answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Japanese Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Japanese language

SELECT a.NoOfAnswers ,count(parentid) AS NoOfPosts
FROM 
(
  SELECT parentid,count(*) AS NoOfAnswers 
  FROM posts p WITH (NOLOCK)
  INNER JOIN PostTypes pt WITH (NOLOCK) ON p.Posttypeid = pt.id 
  where pt.Name='Answer'
  GROUP BY parentid
) AS a
GROUP BY a.NoOfAnswers
HAVING count(parentid) > 1

Enter Parameters

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