Percentage of anwers accepted

1

Please login or register to vote for this query.

(click on this box to dismiss)

Worldbuilding

Q&A for writers/artists using science, geography and culture to construct imaginary worlds and settings

select ans.OwnerUserId as [User Link],
      --ans.OwnerUserId, 
      --acc.OwnerUserId,
      ans_cnt,
      acc_cnt,
      cast(acc_cnt as float)/ans_cnt as pct_acc
FROM     

  (select OwnerUserId,
      count(*) as ans_cnt
  from posts
  where CreationDate > '2017-01-01'
      and PostTypeId = 2
  Group by OwnerUserId) as ans
  
  join

  (select b.OwnerUserId,
    count(*) as acc_cnt
  from Posts as a 
      INNER JOIN
      Posts as b
      ON a.AcceptedAnswerId = b.Id
  where a.CreationDate > '2017-01-01'
  Group by b.OwnerUserId) as acc
  ON ans.OwnerUserId = acc.OwnerUserId
--where ans_cnt > 100
order by pct_acc desc, ans_cnt desc

Enter Parameters

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