Comment text search, with related post link


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- also displays both related users (main text + comment)

-- CommentText: Enter keyword for search in comments: 

            c.PostId AS [Post Link],
            COALESCE(u.DisplayName, c.UserDisplayName) AS [User],
            c.Id AS [Comment Link]
            --, c.Text  -- Comment link also shows text.
FROM        Comments    c
LEFT JOIN   Users       u
ON          c.UserId =
WHERE       c.Text like '%##CommentText##%'
ORDER BY    c.CreationDate

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results