UV to DV ratio of active users with positive contribution

0

Please login or register to vote for this query.

(click on this box to dismiss)

Signal Processing Meta

Q&A about the site for practitioners of the art and science of signal, image and video processing

with cte as (
select distinct users.id, upvotes, downvotes, upvotes/downvotes as ratio
from users
inner join posts as p on users.id = p.OwnerUserId
where 
reputation > 200
and downvotes > 0
and p.CreationDate >= dateadd(month, -6, getdate())
and p.Score > 0
)
select
  format(sum(case when ratio > 20 then 1 else 0 end),'N0') as twenty
, format(sum(case when ratio > 10 then 1 else 0 end),'N0') as ten
, format(sum(case when ratio > 5 then 1 else 0 end),'N0') as five
, format(sum(case when ratio > 1 then 1 else 0 end),'N0') as [more upvotes]
, format(sum(case when ratio = 5 then 1 else 0 end),'N0') as [the same]
, format(sum(case when ratio < 1 then 1 else 0 end),'N0') as [more downvotes]
from cte

Enter Parameters

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