crap query

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

WITH 
unanswered_questions AS
(
  SELECT q.Id,
         q.OwnerUserId
  FROM Posts q
  -- credits to sam.saffron in https://data.stackexchange.com/stackoverflow/query/4038/find-interesting-unanswered-questions
  WHERE (SELECT COUNT(*) FROM Posts a WHERE a.ParentId = q.Id and a.Score > 0) = 0
  -- AND q.CommunityOwnedDate IS NULL 
  AND q.ClosedDate IS NULL 
  AND q.ParentId is null 
  AND q.AcceptedAnswerId IS NULL
  AND NOT EXISTS 
        (
         SELECT *
         FROM PostHistory ph
         WHERE ph.PostId = q.Id
         AND ph.PostHistoryTypeId = 14 -- not locked.
         )
)

 SELECT p.Id,
        p.Score,
        p.CreationDate,
        c.Text--,
--        t.TagName
 FROM unanswered_questions u
 INNER JOIN Posts p ON p.ParentId = u.Id
 INNER JOIN Comments c ON c.PostId = p.Id
 WHERE u.OwnerUserId = c.UserId -- comments from OP.
       --AND (LOWER(c.Text) LIKE '%solved%'
            --OR LOWER(c.Text) LIKE '%worked%')

Enter Parameters

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