Upvote/downvote ratio

2

Please login or register to vote for this query.

(click on this box to dismiss)

Users with the lowest upvote/downvote ratio

Physics

Q&A for active researchers, academics and students of physics

SELECT top (##TopX?100##)
    row_number() over
        (order by convert(float, UpVotes)/(DownVotes+0.0000001),
         DownVotes desc, UpVotes asc, DisplayName, CreationDate) as Rank,
    Id AS [User Link],
    1.0*UpVotes/nullif(DownVotes,0) as [Up/down ratio],
    1.0*DownVotes/nullif(UpVotes,0) as [Down/up ratio],
    UpVotes,
    DownVotes,
    (UpVotes+DownVotes) as TotalVotes
INTO #Downvoters
FROM
    Users
WHERE
    DownVotes >= ##MinDownvotes?5##
    and (DownVotes+UpVotes) >= ##MinVoteTotal?100##
    and Id > -1

SELECT Rank, [User Link],
    round([Up/down ratio],3) as [Up/down ratio],
    round([Down/up ratio],3) as [Down/up ratio],
    UpVotes, DownVotes, TotalVotes
FROM #Downvoters
ORDER BY Rank

SELECT Rank, case when [Down/up ratio] > ##RatioCap?200##
  then ##RatioCap## else [Down/up ratio] end
  as [Down/up ratio, capped at ##RatioCap##]
FROM #Downvoters
ORDER BY Rank

Enter Parameters

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