Q&A for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry
SELECT P.Id AS [Post Link], (LEN(P.Body) - LEN(REPLACE(P.Body, 'ERROR', '____'))) AS MatchCount, P.Score FROM ( SELECT P.Id, P.Body COLLATE Latin1_General_BIN AS Body, P.PostTypeId, P.Score FROM Posts P WHERE P.Body COLLATE Latin1_General_BIN LIKE '%ERROR%ERROR%' ) P WHERE P.PostTypeId = 2 AND LEN(P.Body COLLATE Latin1_General_BIN) > 200 --(LEN(P.Body) - LEN(REPLACE(P.Body, 'ERROR', '____'))) >= 2 AND P.Score <= 2 ORDER BY [MatchCount] DESC ;