Percentage of questions that have an accepted answer

1

Please login or register to vote for this query.

(click on this box to dismiss)

Politics Meta

Q&A about the site for people interested in governments, policies, and political processes

declare @qc int
declare @ac int
select @qc = count(*), 
@ac = sum(case when AcceptedAnswerId is null then 0 else 1 end)
from Posts q
where PostTypeId = 1

select @qc as Questions,
@ac as HasAcceptedAnswer,
(@ac*100.0/@qc) as HasAcceptedAnswerPercentage

Enter Parameters

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