Compare Tags by View Count & Score

0

Please login or register to vote for this query.

(click on this box to dismiss)

Genealogy and Family History Meta

Q&A about the site for expert genealogists and people interested in genealogy or family history

DECLARE @TagName1 nvarchar(35) = 'software-industry'
DECLARE @TagName2 nvarchar(35) = 'germany'

SELECT
  Tags.TagName
  , AVG(Score) AS 'Average Score'
  , AVG(ViewCount)  AS 'Average View Count'
FROM 
  Posts
INNER JOIN 
  PostTags ON Posts.Id=PostTags.PostId
  LEFT JOIN 
    Tags ON PostTags.TagId = Tags.Id
WHERE Tags.TagName IN (
    @TagName1
    , @TagName2
  )
GROUP BY 
  Tags.TagName

Enter Parameters

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