Comments per tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Role-playing Games

Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games

select numComments, numPosts, nc.tagName, (numComments*1.0)/numPosts as commentTagRatio from
(select count(*) as numComments, tagName
from comments join posts on (comments.postid = posts.id) 
join posttags on (posts.id = posttags.postid)
join tags on (posttags.tagid = tags.id)
group by tagName) nc join
(select count(*) as numPosts, tagName
from posts join posttags on (posts.id = posttags.postid)
join tags on (posttags.tagid = tags.id)
group by tagName) np on (nc.tagName = np.tagName)
where numPosts > 10
order by commentTagRatio desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results