SELECT Tags.TagName, COUNT(*) as PostCount, AVG(CAST(Post...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ebooks

Q&A for ebook publishers and readers

SELECT 
    Tags.TagName,
    COUNT(*) as PostCount,
    AVG(CAST(Posts.Score as FLOAT)) as AvgScore,
    SUM(Posts.ViewCount) as TotalViews
FROM Posts
LEFT JOIN PostTags ON Posts.Id = PostTags.PostId
LEFT JOIN Tags ON PostTags.TagId = Tags.Id
WHERE Posts.CreationDate >= DATEADD(YEAR, -2, GETDATE())
    AND Posts.PostTypeId = 1
GROUP BY Tags.TagName
HAVING COUNT(*) > 10
ORDER BY PostCount DESC;

Enter Parameters

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