Average Answerer's Age (among the tags answered by more than 1000 users with age filled)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Network Engineering

Q&A for network engineers

-- Average Answerer's Age (among the tags answered by more than 1000 users with age filled)

SELECT  TagName AS Tags, AVG(Age * 1.0) AS [Average Answerers Age], COUNT(*) AS [Number of Answerers]
FROM    (
        SELECT  DISTINCT pa.OwnerUserId, pt.TagId
        FROM    Users u
        JOIN    Posts pa
        ON      pa.OwnerUserId = U.Id
        JOIN    Posts pq
        ON      pq.Id = pa.ParentId
        JOIN    PostTags pt
        ON      pt.PostId = pq.Id
        ) ut
JOIN    Tags t
ON      t.Id = ut.TagId
JOIN    Users u
ON      u.Id = ut.OwnerUserId
WHERE   u.Age BETWEEN 10 AND 90
GROUP BY
        t.Id, t.TagName
HAVING  COUNT(*) > 1000
ORDER BY
        2 DESC

Enter Parameters

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