Comments score

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

-- How many upvotes do I have for each comments I made?

DECLARE @UserId int = ##UserId##

SELECT
  P1.Id AS PostId, 
  CASE P1.PostTypeId
  WHEN 1 THEN P1.Title
  WHEN 2 THEN P2.Title
  END AS Question,
  Comments.Score
  
FROM
  Comments
  INNER JOIN Posts AS P1 ON P1.Id = Comments.PostId
  FULL JOIN Posts AS P2 ON P2.Id = P1.ParentId
WHERE
  Comments.UserId = @UserId
ORDER BY
  Comments.Score DESC

Enter Parameters

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