Percentage of anwers accepted

1

Please login or register to vote for this query.

(click on this box to dismiss)

Startups Meta

Q&A for entrepreneurs faced with delivering a new product or service under conditions of significant uncertainty

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 sites:
loading Hold tight while we fetch your results