Whats the age demographic per tag?

0

Please login or register to vote for this query.

(click on this box to dismiss)

I tried to make this accept the tag as a parameter but I kepy getting an error.

Webmasters

Q&A for pro webmasters

-- Whats the age demographic per tag?
-- I tried to make this accept the tag as a 
-- parameter but I kepy getting an error.

--DECLARE @TagParam varchar = ##TagParam##


SELECT 
    TagName,    
    count(TagName) as TagsPerAge,  
    Age    
FROM Tags
    INNER JOIN PostTags ON PostTags.TagId = Tags.id
    INNER JOIN Posts ON Posts.ParentId = PostTags.PostId
    INNER JOIN Users ON Users.id = Posts.OwnerUserId 
WHERE TagName = 'php' AND age > 0
GROUP BY Age, TagName
ORDER BY TagsPerAge DESC

Enter Parameters

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