Vote comments on user posts

0

Please login or register to vote for this query.

(click on this box to dismiss)

Russian Language

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

SELECT
    *,
    'http://stackoverflow.com/questions/'+QuestionId+'/#comment'+CommentId+'_'+QuestionId AS Url
FROM (
  SELECT
    COALESCE(Q.Title, Posts.Title) AS Question,
    Comments.UserDisplayName AS Commenter,
    Text AS Comment,
    Posts.OwnerDisplayName AS Poster,
    PostTypes.Name AS [Post type],
    Posts.CreationDate,
    CAST(Comments.Id AS NVARCHAR) AS CommentId,
    CAST(COALESCE(Posts.ParentId, Posts.Id) AS NVARCHAR) AS QuestionId
  FROM Comments 
  JOIN Posts ON Comments.PostId=Posts.Id
  JOIN PostTypes ON PostTypes.Id=Posts.PostTypeId
  LEFT JOIN Posts AS Q ON Q.Id=Posts.ParentId
  WHERE Posts.OwnerUserId=##USERID## AND (
    Comments.Text LIKE '%+1%' OR Comments.Text LIKE '%-1%'
  )
) AS t
ORDER BY CreationDate DESC

Enter Parameters

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