Tags used in conjunction with [tag:harry-potter]

0

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy

Q&A for science fiction and fantasy enthusiasts

SELECT 
  t.tagname AS TagName,
  t.count AS TagCountTotal,
  COUNT(p.id) OVER (PARTITION BY t.id) AS TagCount,
  p.id AS [Post Link],
  p.tags AS Tags, 
  exc.body AS Excerpt
FROM tags target
JOIN posttags pt ON (target.id = pt.tagid)
JOIN posts p ON (pt.postid = p.id)
JOIN posttags tp ON (p.id = tp.postid)
JOIN tags t ON (t.id = tp.tagid AND t.id <> target.id)
LEFT JOIN posts exc ON (t.excerptpostid = exc.id)
WHERE UPPER(target.tagname) LIKE '%HARRY%POTTER%'
ORDER BY TagCount DESC

Enter Parameters

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