Favorites usage rates

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast 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 to meta site
loading Hold tight while we fetch your results