Users with most answers to closed questions

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 top 100
  u.id as [User Link],
  closed as [Closed],
  total as [Total],
  100 * closed / total as [%]
from users u
inner join (
  select owneruserid, count(*) as total
  from posts
  where posttypeid = 2
  group by owneruserid
  ) a_tot on a_tot.owneruserid = u.id
inner join (
  select owneruserid, count(*) as closed
  from posts a
  where posttypeid = 2 and exists (
    select id, parentid from posts q
    where q.posttypeid = 1 and a.parentid = q.id and q.closeddate is not null
    )
  group by owneruserid
  ) a_closed on a_closed.owneruserid = u.id
where closed > 20
order by [%] desc

Enter Parameters

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