Potentially abandoned questions with inactive owners

0

Please login or register to vote for this query.

(click on this box to dismiss)

Returns questions that are old (+6 months), have low views and score, have no upvoted or accept answer and where the user hasn't been active in the last 6 months. Modified from the query build out of this conversation http://chat.stackexchange.com/transcript/message/409809#409809

Chess Meta

Q&A about the site for serious players and enthusiasts of chess

-- Potentially abandoned questions with inactive owners
-- Returns questions that are old (+6 months), have low views and score, 
-- have no upvoted or accept answer and where the user hasn't been active
-- in the last 6 months.
--
-- Modified from the query build out of this conversation
-- http://chat.stackexchange.com/transcript/message/409809#409809

SELECT TOP 1000
  p.Id AS [Post Link],
  p.Score,
  p.ViewCount AS Views,
  p.AnswerCount AS Answers,
  CASE
  WHEN p.ClosedDate IS NULL THEN NULL ELSE 'Y' END AS Closed,
  DateDiff(month,p.LastActivityDate,getdate()) AS MonthsOld,
  u.Id AS [User Link],
  DateDiff(month,u.LastAccessDate,getdate()) AS MonthsLastUserAct,
  CONVERT(varchar(4),Year(u.LastAccessDate)) + '-' + CONVERT(varchar(2),Month(u.LastAccessDate)) AS ULastAccess

FROM Posts p
LEFT JOIN Users u on p.OwnerUserId = u.Id

WHERE p.PostTypeId = 1
  AND p.ViewCount < 200
  AND p.Score < 4
  AND p.AcceptedAnswerId IS NULL
  AND NOT EXISTS (SELECT c.[Id]
                  FROM [Posts] c 
                  WHERE c.[Score] > 0 
                    AND c.[ParentId] = p.[Id])
  AND p.LastActivityDate < dateadd(month,-6,getdate())
  AND u.LastAccessDate <dateadd(month,-6,getdate())

ORDER BY
  p.Score,
  p.AnswerCount DESC,
  p.ViewCount

Enter Parameters

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