select dateadd(month, datediff(month, 0, a.CreationDate),...

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 dateadd(month, datediff(month, 0, a.CreationDate), 0) mo, 
  count(*) "Answers to duplicates"
from Posts a
join PostLinks l on l.PostId=a.ParentId and l.RelatedPostId in 
  (
    select RelatedPostId
    from PostLinks
    where LinkTypeId=3
    group by RelatedPostId
    --having count(*) >= 20
  )
  where a.CreationDate < dateadd(month, datediff(month, 0, getdate()), 0)
group by dateadd(month, datediff(month, 0, a.CreationDate), 0)
order by dateadd(month, datediff(month, 0, a.CreationDate), 0)

Enter Parameters

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