My Comment Score distribution

0

Please login or register to vote for this query.

(click on this box to dismiss)

How many comments do I have for each score.

Engineering

Q&A for professionals and students of engineering

DECLARE @UserId int = ##UserId##

SELECT 
    Count(*) AS CommentCount,
    Comments.Score,
    Comments.Text,
    Posts.Id As [Post Link]
FROM 
    Comments, Posts
WHERE 
    UserId = @UserId AND PostId = Posts.Id
GROUP BY 
    Comments.Score, Comments.Text, Posts.Id
ORDER BY 
    Score DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results