Select all answered questions with a specific tag

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

SELECT p.Id, p.CreationDate, p.Title, p.Body, a.Body AS "Answer"
FROM Posts p
JOIN PostTags pt ON p.Id = pt.PostId
JOIN Tags t ON pt.TagId = t.Id
JOIN Posts a ON p.AcceptedAnswerId = a.Id
WHERE (t.TagName = ##TagName:string##) AND 
(p.AcceptedAnswerId IS NOT NULL) AND
(p.CreationDate >= '##Date1?2008-01-01##') AND
(p.CreationDate <= '##Date2?2008-12-31##')
ORDER BY p.CreationDate ASC
-- TagName: Tag Name:
-- Date1: Start Date:
-- Date2: End Date:

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results