Name and rep of commenter and OP for comment ID

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
  CASE WHEN U.Id = P.OwnerUserId THEN 'Poster' ELSE 'Commenter' END AS [User],
  U.Id AS [User Link],
  U.Reputation AS [User Rep]
FROM Comments AS C
INNER JOIN Posts AS P
  ON P.Id = C.PostId
INNER JOIN Users AS U
  ON U.Id IN (P.OwnerUserId, C.UserId)
WHERE C.Id = ##CommentId:int##

Enter Parameters

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