with firstquery as ( Select owneruserid From Posts B Wher...


Please login or register to vote for this query.

(click on this box to dismiss)

Super User

Q&A for computer enthusiasts and power users

--select distinct (select owneruserid from posts where id = comments.postid),creationdate  from comments 
--where postid in
with firstquery as (
Select owneruserid
From Posts B
Where B.Posttypeid = 1 and month(creationdate) = 12  and year(creationdate) = 2016
  And B.Answercount > 0 
  And Datediff(Day,B.Creationdate,(Select Min(Creationdate) From Posts  Where Parentid = B.Id) ) >= 30
 -- )
--order by postid,creationdate asc
select distinct owneruserid,count(*) count from posts 
where owneruserid in (select distinct owneruserid from firstquery)
and posttypeid = 1 and year(creationdate) = 2017 and month(creationdate) <= 10
group by owneruserid
order by count desc

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results