Q&A for Ubuntu users and developers
SELECT DATEPART(yyyy, CreationDate) as Year, DATEPART(q, CreationDate) as Quarter, COUNT(DISTINCT CASE when PostTypeId = 1 then OwnerUserId else null END) as Questioning, COUNT(DISTINCT CASE when PostTypeId = 2 then OwnerUserId else null end) as Answering FROM Posts GROUP BY DATEPART(yyyy, CreationDate) , DATEPART(q, CreationDate) ORDER BY DATEPART(yyyy, CreationDate) , DATEPART(q, CreationDate)