select top 50 Id as [User Link], Upvotes, Downvotes, (upv...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Super User

Q&A for computer enthusiasts and power users

select top 50 
 Id as [User Link], Upvotes, Downvotes,
 (upvotes + downvotes) as AllVotes,
 (select count(*) from comments c where c.userid = u.id) as Comments,
 (cast(Upvotes as float) / cast(Downvotes as float)) as UpPerDown,
 log(cast(Upvotes as float) / cast(Downvotes as float)) as PositivityScore,
 (cast((select count(*) 
        from comments c inner join posts p on p.Id = c.PostId 
        where c.userid = u.id and p.Score <= 0) as float) /
  cast(Downvotes as float)) as CommPerMaybeDv
from users u 
where Upvotes > 0 and Downvotes > 0 and u.Id > 0 and
 abs(datediff(d, getdate(), u.LastAccessDate)) <= 30 
order by AllVotes desc

Enter Parameters

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