SELECT p.CreationDate, CASE WHEN (2 = p.PostTypeId) THEN ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers Meta

Q&A about the site for Drupal developers and administrators

SELECT p.CreationDate,
  CASE WHEN (2 = p.PostTypeId) THEN 'Answer'
       ELSE                         'Question'
       END AS PostType,
  p.Score,
  CASE WHEN (2 = p.PostTypeId) THEN t.Title
       ELSE                         p.Title
       END AS QuestionTitle,
  p.Body,
  p.Id as [Post Link]
FROM Posts p LEFT OUTER JOIN Posts t on (p.ParentId = t.Id)
WHERE 1=1 AND

-- only needed on Stack Overflow
--p.CreationDate >= DATEADD(DAY, -10, GETDATE()) AND

-- Inactive for at least 6 months
p.LastActivityDate <= DATEADD(DAY, -185, GETDATE()) AND
-- (only needed on StackOverflow) Inactive for exactly 6 months
p.LastActivityDate >= DATEADD(DAY, -185 - 40, GETDATE()) AND

(
UPPER(p.Body) LIKE UPPER('%Thanks!%')
OR
UPPER(p.Body) LIKE UPPER('%Appreciated!%')
OR
UPPER(p.Body) LIKE UPPER('%thanks in advance%')
)

ORDER BY p.LastActivityDate DESC

Enter Parameters

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