SELECT ROUND(1.0*SUM(CASE WHEN VoteTypeId=3 THEN 1 ELSE 0...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
  ROUND(1.0*SUM(CASE WHEN VoteTypeId=3 THEN 1 ELSE 0 END)/SUM(CASE WHEN VoteTypeId=2 THEN 1 ELSE 0 END),3) AS ratio
FROM Votes
WHERE VoteTypeId IN (2,3)

Enter Parameters

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