SELECT tagname1, dup, total from ( SELECT TOP 5 Tags.TagN...

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 from (
SELECT TOP 5 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 TOP 5 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 total desc

Enter Parameters

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