SELECT TOP 2000 C.Id AS [Comment Link], P.Score, C.PostId...

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 2000
  C.Id AS [Comment Link],
  P.Score,
  C.PostId,
  C.Text
FROM Comments C
JOIN Posts P ON P.Id = C.PostId
WHERE
  C.Text COLLATE Latin1_General_BIN LIKE '%[tT]hank%'
  AND C.Text COLLATE Latin1_General_BIN NOT LIKE '% but %'
  AND C.Text COLLATE Latin1_General_BIN NOT LIKE '%?%'
  AND LEN(C.Text) <= 45
ORDER BY P.Score DESC, C.PostId
;

Enter Parameters

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