with AcceptedAnswers as ( select a.ParentId QuestionId, a...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

with AcceptedAnswers as
(
  select a.ParentId QuestionId, a.Id AnswerId, a.OwnerUserId
  from Posts a
  where PostTypeId=2
  and exists (select 1 from Posts q where q.AcceptedAnswerId=a.Id)
)

select Format(count(*)*1.0/(select count(*) from AcceptedAnswers), 'P') PctGoldBadgeAcceptedAnswers
from AcceptedAnswers aa
where exists (select 1 
  from PostTags pt
  join Tags t on t.Id=pt.TagId
  join Badges b on b.Name=t.TagName and TagBased=1 and Class=1
  where pt.PostId=aa.QuestionId
    and b.UserId=aa.OwnerUserId)

Enter Parameters

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