SELECT t.tagname, COUNT(DISTINCT p.owneruserid) AS Users ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT t.tagname,
       COUNT(DISTINCT p.owneruserid) AS Users
FROM users u
     JOIN posts p ON p.owneruserid = u.id
     JOIN posttags pt ON pt.postid = p.ParentId
     JOIN tags t ON t.id = pt.tagid
WHERE p.posttypeid = 2
  AND p.score > 0
  AND t.tagname IN ('c','java','mysql','c#')
GROUP BY t.tagname;

SELECT t.tagname,
       COUNT(*) as NumAnswers
FROM users u
     JOIN posts p ON p.owneruserid = u.id
     JOIN posttags pt ON pt.postid = p.ParentId
     JOIN tags t ON t.id = pt.tagid
WHERE p.posttypeid = 2
  AND p.score > 0
  AND t.tagname IN ('c','java','mysql','c#')
GROUP BY t.tagname;

Enter Parameters

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