Comments posted by a user on somebody else's post

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
  p.Id AS [Post Link],
  'site://q/' + Convert(VarChar(10), p.Id) + '#comment' +  Convert(VarChar(10), p.Id) + '_' + Convert(VarChar(10), c.Id) + '|' + c.Text AS [Comment],
  c.Score AS [Score],
  p.CreationDate AS [Post date],
  c.CreationDate AS [Comment date]
FROM Posts p
INNER JOIN Comments c
ON c.PostId = p.Id
WHERE c.UserId = ##User##
  AND p.OwnerUserId != ##User##
ORDER BY c.CreationDate ASC

Enter Parameters

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