SELECT tagname1, dup/total dup, total from ( SELECT Tags....

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

SELECT tagname1, dup/total dup, total from (
SELECT Tags.TagName as tagname1, COUNT(distinct PostTags.PostId) AS dup FROM PostTags
LEFT JOIN PostLinks on PostLinks.PostId = PostTags.PostId
JOIN Tags on PostTags.TagId = Tags.Id

WHERE LinkTypeId = 3
group by Tags.TagName
) dups
LEFT JOIN (

SELECT Tags.TagName AS tagname, COUNT(distinct PostTags.PostId) AS total FROM PostTags
LEFT JOIN PostLinks on PostLinks.PostId = PostTags.PostId
JOIN Tags on PostTags.TagId = Tags.Id
group by Tags.TagName
)tots
ON dups.tagname1 = tots.tagname
order by dup/total desc

Enter Parameters

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