questions per tag (count, answered, unanswered, accepted)


Please login or register to vote for this query.

(click on this box to dismiss)

this excludes deleted posts


Q&A for biology researchers, academics, and students

select tagname
     , count(*) [tot Q.]
     , sum(case when p.answercount > 0 then 1 else 0 end) [q answered . ]
     , sum(case when p.answercount = 0 then 1 else 0 end) [q not answered . ]
     , sum(case when p.acceptedanswerid is not null then 1 else 0 end) [q has accepted A]
from tags t
inner join posttags pt on pt.tagid =
inner join posts p on = pt.postid
group by tagname
order by count(*) desc;

/* experiment to find all posttags */
select [postid]
     , [tagid]
into #posttagsdeleted
from postswithdeleted pwd
cross apply string_split(tags,'<') tagnames
inner join tags t on t.tagname = replace(tagnames.value,'>', '')
select *
from #posttagsdeleted

select *
from postswithdeleted
where deletiondate is not null

Enter Parameters

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