Tags that are used together on posts without another tag.

1

Please login or register to vote for this query.

(click on this box to dismiss)

Magic is purple!

Stack Overflow

Q&A for professional and enthusiast programmers

-- Tagsthat are used together excluding another
-- Magic is purple!
select top 100
  t1.TagName as [Used Togeather With], count(p1.PostId) as [Post Count]
from PostTags p1
join PostTags p2
  on p2.PostId = p1.PostId and
     p2.TagId != p1.TagId and
     p2.TagId in (select t2.Id from Tags t2 where t2.TagName like ##WithTag:string##)
left join PostTags p3
  on p3.PostId = p1.PostId and
     p3.TagId in (select t3.Id from Tags t3 where t3.TagName like ##WithoutTag:string##)
join Tags t1
  on t1.Id = p1.TagId
where p3.PostId is null
group by t1.TagName
order by count(p1.PostId) desc

Enter Parameters

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