SELECT t.Id, t.TagName, COUNT(DISTINCT PostId) FROM Posts p

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

SELECT t.Id, t.TagName, COUNT(DISTINCT PostId)
FROM Posts p
JOIN PostTags pt ON pt.PostId = p.Id
JOIN Tags t ON t.Id = pt.TagId
GROUP BY t.Id, t.TagName

Enter Parameters

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