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.

Computational Science

Q&A for scientists using computers to solve scientific problems

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

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

Enter Parameters

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