select t.TagName as Tag from PostTags as pt1 INNER JOIN...

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

-- Input a base tag.  The query then finds the top 25 related 
-- tags used with that base tag.

select t.TagName as Tag

from PostTags as pt1
  INNER JOIN Tags as t ON pt1.TagId = t.Id
  INNER JOIN PostTags as pt2 ON pt1.PostId = pt2.PostId AND pt1.TagId <> pt2.TagId

where t.TagName = ##MyTag:string##  -- MyTag: Base Tag

Enter Parameters

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