select top 100 C.id as [User Link], sum(D.downvotes) as d...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

select top 100 C.id as [User Link], sum(D.downvotes) as downvotes,
datediff(dd,C.CreationDate,getdate()) as age,
CAST(sum(D.downvotes)/datediff(dd,C.CreationDate,getdate()) as decimal) as ave
from Users as C inner join (
  select A.id as postId, A.ownerUserId as userId, B.downvotes
  from Posts as A inner join (  
    select postId, count(*) as downvotes
    from Votes
    where voteTypeId = 3
    group by postId
  ) as B
  on A.id = B.postId
) as D
on C.id = D.userId
where C.Reputation != 1
group by C.id,age,C.CreationDate
order by ave desc

Enter Parameters

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