Number of unique users on Questions posted per month for a given tag and time duration


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 count(DISTINCT temp_p.OwnerUserId) AS USERS,
       DATENAME(mm, temp_p.CreationDate) AS MONTH_NAME,
       DATENAME(yyyy, temp_p.CreationDate) AS YEAR,
       MONTH(temp_p.CreationDate) AS MONTH_NUM
  select  p3.OwnerUserId, p3.CreationDate
    from  Posts p3, PostTags ptags3, Tags t3, PostTypes ptypes3 
   where  p3.posttypeid =
     and = 1
     and = ptags3.postid 
     and  ptags3.tagid = 
     and  t3.tagname = '##TagName##'
     and  p3.CreationDate >= '##startdate##'
     and  p3.CreationDate <= '##enddate##'
) temp_p
group by DATENAME(yyyy, temp_p.CreationDate), MONTH(temp_p.CreationDate), DATENAME(mm, temp_p.CreationDate)
order by DATENAME(yyyy, temp_p.CreationDate) ASC, MONTH(temp_p.CreationDate) ASC, DATENAME(mm, temp_p.CreationDate) ASC

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results