Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language
SELECT TOP(##num?500##) t.TagName, t.Count, AVG(CAST(p.Score AS decimal)) [Average Score], AVG(CAST(p.ViewCount AS decimal)) [Average ViewCount], AVG(CAST(p.AnswerCount AS decimal)) [Average AnswerCout] FROM Posts p INNER JOIN PostTags pt ON p.Id = pt.PostId INNER JOIN Tags t ON pt.TagId = t.Id WHERE (t.Count>=##min?10##) AND (t.Count<=##max?1000000000000##) ---I have included both parameters min and max ---Sometimes we're interestedonly in large tags. ---Sometimes we might want to look only at small tags GROUP BY t.TagName, t.Count ORDER BY t.Count DESC