Find tags differing by dots and dashes only with no synonym

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SELECT Tags.TagName AS NoDotDashTagName,
       Tags.Count AS NoDotDashTagCount,
       Tags2.TagName AS DotDashTagName,
       Tags2.Count AS DotDashTagCount
FROM Tags
CROSS JOIN Tags AS Tags2
WHERE Tags.TagName <> Tags2.TagName AND
      (REPLACE(REPLACE(Tags2.TagName, '.', ''), '-', '') = Tags.TagName) AND

      NOT EXISTS(SELECT *
                 FROM TagSynonyms
                 WHERE (SourceTagName = Tags.TagName AND
                        TargetTagName = Tags2.TagName) OR
                       (TargetTagName = Tags.TagName AND
                        SourceTagName = Tags2.TagName)
                )
                
ORDER BY Tags.TagName

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached