"Thanks" comments on accepted answers

2

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @NumComments INT = ##NumComments?100##

SELECT TOP (@NumComments) Id AS [Comment Link]
FROM Comments
WHERE (
    Text LIKE 'thank you%' COLLATE SQL_Latin1_General_CP1_CI_AS OR
    Text LIKE 'thanks%' COLLATE SQL_Latin1_General_CP1_CI_AS
)
AND EXISTS(
    SELECT *
    FROM Votes
    WHERE VoteTypeId = 1 AND PostId = Comments.PostId
)
ORDER BY LEN(Text)

Enter Parameters

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