With SingleTags As ( SELECT TagId FROM PostTags GROUP BY ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

With SingleTags As
(
  SELECT TagId FROM PostTags GROUP BY TagId HAVING Count(*) = 1
)
SELECT t.TagName, p.ID As PostID, p.Title, p.CreationDate 
FROM SingleTags st
INNER JOIN PostTags pt ON pt.tagId = st.TagId 
INNER JOIN Posts p ON p.id = pt.postid 
INNER JOIN Tags t ON t.ID = st.TagID
WHERE p.CreationDate < DateAdd(m, -3, getdate())
ORDER BY p.CreationDate

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached