Select avg(q.Id) as qId, avg(q.Id) as [Post Link], count(...

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

Select 
  avg(q.Id) as qId,
  avg(q.Id) as [Post Link], 
  count(hs.Id) as HSA, 
  avg(aa.Score) as AAS,
  max(hs.Score) as HS,
  max(hs.Score) - avg(aa.Score) as SD
From 
  Posts as q
  join Posts as aa on q.Id = aa.ParentId and aa.Id = q.AcceptedAnswerId
  join Posts as hs on q.Id = hs.ParentId and aa.Id != hs.Id and aa.Score < hs.Score
Where
  q.PostTypeId = 1 and
  q.AnswerCount > 1 and
  (aa.OwnerUserId != q.OwnerUserId or aa.OwnerUserId is null)
Group by 
  q.Id

Enter Parameters

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