Percentage of duplicate questions grouped by tag related to a starting tag

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

WITH 
TaggedQuestions AS (
  SELECT PostTags.* from PostTags 
  INNER JOIN Tags ON Tags.Id = PostTags.TagId
  WHERE Tags.TagName = ##Tag:string##
),
RelatedQuestions AS (
  SELECT PostTags.* FROM PostTags
  INNER JOIN TaggedQuestions ON PostTags.PostId = TaggedQuestions.PostId
)

SELECT * FROM (
SELECT t.TagName,
(
SELECT Round(COUNT(*)*100.0/t.Count, 2)
  FROM PostLinks pl
  INNER JOIN RelatedQuestions rq ON rq.PostId = pl.PostId
  WHERE pl.LinkTypeId = 3 AND rq.TagId = t.Id
) percentage
FROM Tags t 
) a
WHERE percentage > ##MinimumPercentage:float?2.0##
ORDER BY percentage DESC

Enter Parameters

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