select OwnerUserId, year, count(month) as active_months f...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Japanese Language Meta

Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language

select 
OwnerUserId,
year,
count(month) as active_months
from
 ( select 
   OwnerUserId,
   DATENAME(year, CreationDate) as year,
   DATENAME(month, CreationDate) as month
   from Posts
   where owneruserid > 0 AND DATENAME(year, CreationDate) >= 2010 AND DATENAME(year, CreationDate) <= 2020 
   group by 
      OwnerUserId 
     ,DATENAME(year, CreationDate)
     ,DATENAME(month, CreationDate)
 ) as dt
 group by OwnerUserId, year
 order by OwnerUserId

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results