Vote Percentages

0

Please login or register to vote for this query.

(click on this box to dismiss)

Calculates the average liklihood that a given vote is a down vote.

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

-- Vote Percentages
-- Calculates the average liklihood that a given vote is a down vote.

SELECT CONVERT(decimal, upvotes.cnt)/CONVERT(decimal, downvotes.cnt) FROM
(SELECT count(*) AS cnt FROM Votes WHERE Votes.VoteTypeId = 2) AS upvotes,
(SELECT count(*) AS cnt FROM Votes WHERE Votes.VoteTypeId = 3) AS downvotes

Enter Parameters

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