declare @population int = (select count(distinct OwnerUse...

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

declare @population int = (select count(distinct OwnerUserId) from Posts)

select count(distinct OwnerUserId) "Users gaining reputation",
       @population "Total users",
       100.0*count(distinct OwnerUserId)/@population "% who gain"
from Posts p
     join Votes v on p.Id = v.PostId
where PostTypeId = 1
      and VoteTypeId = 2

Enter Parameters

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