Tag associated with other tags

1

Please login or register to vote for this query.

(click on this box to dismiss)

English

Q&A for linguists, etymologists, and serious English language enthusiasts

select top ##Limit?250##
  MAX(t2.TagName) as LeftTag,
  MAX(t.TagName) as RightTag,
  COUNT(pt2.TagId) as LeftCount,
  MAX(t.Count) as RightCount,
  (CAST(COUNT(pt2.TagId) AS float)/CAST(MAX(t.Count) AS float)) as Per
from
  PostTags pt
  JOIN PostTags pt2 on pt.PostId = pt2.PostId
  JOIN Tags t on pt.TagId = t.Id
  JOIN Tags t2 on pt2.TagId = t2.Id
where
  ('##LeftTag?all##' = 'all' OR t2.TagName = '##LeftTag##')
  AND ('##RightTag?all##' = 'all' OR t.TagName = '##RightTag##')
  AND t.Count >= ##TagCountFilter?10##
  AND t2.Count >= ##TagCountFilter##
  AND pt.TagId != pt2.TagId
group by
  pt.TagId,
  pt2.TagId
having
##PerFilter?0## <= 0 OR (CAST(COUNT(pt2.TagId) AS float)/CAST(MAX(t.Count) AS float)) > ##PerFilter##
order by
  --RightCount DESC,
  Per DESC

Enter Parameters

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