Favorites usage rates

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select
  '0' as [Cut Off],
  count(distinct UserId) as [Users With Favs],
  count(distinct Users.Id) as [User Count],
  (count(distinct UserId) * 100.0) / count(distinct Users.Id) as [Percent]
from Users
left join Votes on UserId = Users.Id and VoteTypeId = 5

union all

select
  '200' as [Cut Off],
  count(distinct UserId) as [Users With Favs],
  count(distinct Users.Id) as [User Count],
  (count(distinct UserId) * 100.0) / count(distinct Users.Id) as [Percent]
from Users
left join Votes on UserId = Users.Id and VoteTypeId = 5
where Reputation > 200

union all

select
  '1000' as [Cut Off],
  count(distinct UserId) as [Users With Favs],
  count(distinct Users.Id) as [User Count],
  (count(distinct UserId) * 100.0) / count(distinct Users.Id) as [Percent]
from Users
left join Votes on UserId = Users.Id and VoteTypeId = 5
where Reputation > 1000

union all

select
  '10000' as [Cut Off],
  count(distinct UserId) as [Users With Favs],
  count(distinct Users.Id) as [User Count],
  (count(distinct UserId) * 100.0) / count(distinct Users.Id) as [Percent]
from Users
left join Votes on UserId = Users.Id and VoteTypeId = 5
where Reputation > 10000

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached