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
  P.PostTypeId IN (1,2)
  AND (C.Text COLLATE Latin1_General_BIN LIKE '%[aA]mazing%'
  OR C.Text COLLATE Latin1_General_BIN LIKE '%[gG]reat%'
  OR C.Text COLLATE Latin1_General_BIN LIKE '%[aA]wesome%'
  OR C.Text COLLATE Latin1_General_BIN LIKE '%[fF]antastic%'
  OR C.Text COLLATE Latin1_General_BIN LIKE '%[bB]eautiful%'
  OR C.Text COLLATE Latin1_General_BIN LIKE '%[eE]legant%'
  OR C.Text COLLATE Latin1_General_BIN LIKE '%[cC]lever%'
  )
  AND C.Text COLLATE Latin1_General_BIN NOT LIKE '%?'
  AND C.Text COLLATE Latin1_General_BIN NOT LIKE '% but %'
  AND LEN(C.Text) <= 60
ORDER BY P.Score DESC, C.PostId
;

Enter Parameters

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