DECLARE @startAfter AS INT = ##startAfter:int##, @count A...

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

DECLARE
  @startAfter AS INT = ##startAfter:int##,
  @count AS INT = ##count:int?90##
  SELECT TOP (@count)
  --'site://posts/comments/'+CAST(C.Id AS NVARCHAR(max))+'|'+CAST(C.Id AS NVARCHAR(max)) AS Id,
  C.Id
  --C.Text
  --C.CreationDate
FROM Comments C
JOIN Posts A ON A.Id = C.PostId
JOIN Posts Q ON Q.Id = A.ParentId
WHERE
  A.PostTypeId = 2
  AND C.UserId <> Q.OwnerUserId
  AND C.UserId <> A.OwnerUserId
  AND 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 '%edit%'
  AND C.Text COLLATE Latin1_General_BIN NOT LIKE '%[fF]ix%'
  AND C.Text COLLATE Latin1_General_BIN NOT LIKE '%[uU]pdat%'
  AND C.Text COLLATE Latin1_General_BIN NOT LIKE '%[oO]ops%'
  AND C.Text COLLATE Latin1_General_BIN NOT LIKE '%?%'
  AND LEN(C.Text) <= 50
  AND C.id > @startAfter
ORDER BY C.Id ASC
FOR JSON PATH
;

Enter Parameters

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