post with the most upvotes per character

0

Please login or register to vote for this query.

(click on this box to dismiss)

SharePoint

Q&A for SharePoint enthusiasts

SELECT top 1
    Id AS PostId,
    LEN(Body) AS CharacterCount,
    Score AS Upvotes,
    CAST(Score AS FLOAT) / NULLIF(LEN(Body), 0) AS UpvotesPerCharacter
FROM
    Posts
WHERE
    PostTypeId = 1  -- Filtering for questions (1) or answers (2) if necessary
ORDER BY
    UpvotesPerCharacter DESC

Enter Parameters

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