User Ratio of Upvotes to Downvotes Received.

1

Please login or register to vote for this query.

(click on this box to dismiss)

Displays the number of upvotes and downvotes received on questions and answers and their ratio.

Italian Language Meta

Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language

-- User's Upvote to Downvote ratio
-- Upvote count, downvote count and ratio

select
    SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS [Up Votes],
    SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS [Down Votes],
    (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS float) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS float)) AS [Up Votes to Down Votes]
from
    Votes v inner join Posts p on v.PostId=p.Id
where
    p.OwnerUserId=##UserId##

Enter Parameters

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