Search My Comments

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 TOP 100 row_number() OVER (ORDER BY c.CreationDate DESC) AS nr
     , c.PostId [Post Link], c.CreationDate, c.Text, c.Score, p.AcceptedAnswerId Answer
FROM   Comments AS c
JOIN   Posts As p ON p.Id = c.PostId
WHERE  c.Text LIKE '%' + ##SearchQuery:string## + '%'
AND    c.UserId = ##UserId:int?939860##  -- My SO userID as default
ORDER  BY c.CreationDate DESC

Enter Parameters

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