My top 100 DBA.SE comments (all time) v3

1

Please login or register to vote for this query.

(click on this box to dismiss)

Japanese Language Meta

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

DECLARE @userId int = 10044; /* NOTE TO SELF: I'm 159145 on StacKoverflow, but 10044 on DBA-SE. */


SELECT
    COUNT(*) AS TotalCommentCount,
    COUNT( CASE WHEN c.Score = 0 THEN 1 END ) AS [Count 0],
    COUNT( CASE WHEN c.Score = 1 THEN 1 END ) AS [Count 1],
    COUNT( CASE WHEN c.Score = 2 THEN 1 END ) AS [Count 2],
    COUNT( CASE WHEN c.Score = 3 THEN 1 END ) AS [Count 3],
    COUNT( CASE WHEN c.Score = 4 THEN 1 END ) AS [Count 4],
    COUNT( CASE WHEN c.Score > 4 THEN 1 END ) AS [Count 5+]
FROM 
    Comments AS c
WHERE
    c.UserId = @userId;

SELECT
    TOP 100
    c.PostId AS [Post Link],
    c.CreationDate,
    c.Score,
    c.[Text]
FROM 
    Comments AS c
WHERE
    c.UserId = @userId
    AND
    c.Score > 1
ORDER BY
    c.Score DESC;

Enter Parameters

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