Count number of questions, answers and comments on a tag


Please login or register to vote for this query.

(click on this box to dismiss)

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

select  u.DisplayName 
,sum( case when posttypeid = 1 then 1 else null end)  [Questions]
,sum( case when posttypeid = 2 then 1 else null end)  [Answers]
,sum( case when posttypeid  in (1,2) then 1 else null end)  [Total]

from posts p
inner join posttags pt on pt.postid = coalesce(p.parentid,
inner join tags t on = pt.tagid
inner join Users u on p.OwnerUserId = u.Id
where tagname = ##tag1:string## collate SQL_Latin1_General_CP1_CI_AI and

 lower(u.Location) like '%saudi%' or
(lower(u.Location) like '%saudi arabia%' 
group by u.DisplayName

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results