select count(a.Id) as [Total Answers], sum(case when q.Ac...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

-- Enter Query Title
-- Enter Query Description
select
    count(a.Id) as [Total Answers],
    sum(case when q.AcceptedAnswerId IS NULL then 0 else 1 end) as [Accepted Answers],  
    sum(case when q.AcceptedAnswerId IS NULL then 0 else 1 end)*1000 / count(a.Id) / 10.0 as [Percentage Accepted]
from
    Posts a
  left join
    Posts q
  on a.Id = q.AcceptedAnswerId
where
      a.OwnerUserId = ##UserId##
  and a.postTypeId = 2

Enter Parameters

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