Which tags with at least 1000 question in past 30 days had most duplicates?

1

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

SELECT Tags.TagName,
       SUM(CASE
       WHEN TRY_CONVERT(int, PostHistory.Comment) IN (1, 101)
       AND TRY_CONVERT(int, PostHistory.PostHistoryTypeId) = 10 THEN 1
               ELSE 0
           END) AS Duplicates,
           COUNT(*) AS Total
FROM Posts
INNER JOIN PostHistory ON PostHistory.PostId = Posts.Id
INNER JOIN PostTags ON PostTags.PostId = Posts.Id
INNER JOIN Tags ON Tags.Id = PostTags.TagId
WHERE Posts.PostTypeId = 1
  AND Posts.CreationDate >= DATEADD(DAY, -30, GETDATE())
  AND Posts.CreationDate <= GETDATE()
GROUP BY Tags.TagName
HAVING COUNT(*) > 9
ORDER BY Duplicates DESC

Enter Parameters

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