Skip to content
kusum18 edited this page Feb 25, 2013 · 2 revisions

Select all

select * from tag_post_map;

distinct tags

select distinct(tags) from tag_post_map;

count of answered tags

select count(id) from tag_post_map where acceptedAnswerId is not Null group by tag;

count of unanswered tags

select count(id) from tag_post_map where acceptedAnswerId is Null group by tag;

distinct answered tags

select distinct(id) from tag_post_map where acceptedAnswerId is not Null;

distinct unanswered tags

select distinct(id) from tag_post_map where acceptedAnswerId is Null;

###tag-wise count of questions select tag,count(*) as c from tag_post_map group by tag order by c desc;

select tag,count() as c from tag_post_map where acceptedAnswerId is not Null group by tag order by c desc; ### answered select tag,count() as c from tag_post_map where acceptedAnswerId is Null group by tag order by c desc; ### not answered

select tag,count(*) as c from tag_post_map where acceptedAnswerId is Null group by tag order by c desc;

Clone this wiki locally