R and Other Question Tags

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

WITH r_tags AS
 (SELECT p.id AS PostId, t.TagName, p.CreationDate, p.Score,
         p.ViewCount, p.OwnerUserId, p.Title,
         p.Tags, p.AnswerCount
    
  FROM Posts p
  JOIN PostTags pt ON p.Id = pt.PostId
  JOIN Tags t ON t.Id = pt.TagId AND t.TagName <> 'r'

  WHERE p.AcceptedAnswerId IS NOT NULL
    AND p.CreationDate >= '2015-01-01'
    AND p.ParentId IS NULL
    AND p.Tags LIKE '%<r>%')
    
SELECT r.TagName, 
       Year(r.CreationDate) As TagYear,
       COUNT(*) AS TagCount,
       MAX(r.Score) As MaxScore,
       MAX(r.ViewCount) AS MaxViewCount,
       MAX(r.AnswerCount) AS MaxAnswerCount
FROM r_tags r
GROUP BY r.TagName,
         Year(r.CreationDate) 
ORDER BY Year(r.CreationDate) DESC,
         COUNT(*) DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results