SELECT Tags.TagName as Region, COUNT(DISTINCT Posts.Id) a...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Lifehacks Meta

Q&A about the site for people looking to bypass life's everyday problems with simple tricks

SELECT 
    Tags.TagName as Region,
    COUNT(DISTINCT Posts.Id) as QuestionCount,
    AVG(CAST(Posts.Score as FLOAT)) as AvgScore,
    SUM(Posts.ViewCount) as TotalViews,
    COUNT(DISTINCT Posts.AcceptedAnswerId) as AcceptedAnswers,
    AVG(CAST(Posts.ViewCount as FLOAT)) as AvgViews
FROM Posts
LEFT JOIN PostTags ON Posts.Id = PostTags.PostId
LEFT JOIN Tags ON PostTags.TagId = Tags.Id
WHERE Tags.TagName IN ('india', 'china', 'japan', 'southeast-asia', 'europe', 'usa', 
    'south-america', 'middle-east', 'africa', 'australia')
    AND Posts.PostTypeId = 1
GROUP BY Tags.TagName
ORDER BY QuestionCount DESC;

Enter Parameters

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