Posts count for all tags

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-------------------------
-- @author: Moradnejad --
-------------------------
SELECT TagName, count(*) as cnt
FROM (
SELECT p.id, T.TagName
from posts as p
inner join PostTags as pt on pt.PostId=p.Id
inner join Tags as t on t.Id=pt.TagId
) as t1
group by TagName
order by cnt desc

Enter Parameters

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