Common tags on both of Physics SE and Math SE

1

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

WITH MathTags AS (
  SELECT
    TagName AS Tag,
    Count FROM [StackExchange.Math].dbo.Tags
  UNION
  SELECT TagSynonyms.SourceTagName AS Tag, Tags.Count
  FROM [StackExchange.Math].dbo.TagSynonyms
  LEFT JOIN [StackExchange.Math].dbo.Tags
    ON TagSynonyms.TargetTagName = Tags.TagName
),
PhysicsTags AS (
  SELECT
    TagName AS Tag,
    Count FROM [StackExchange.Physics].dbo.Tags
  UNION
  SELECT
    TagSynonyms.SourceTagName AS Tag,
    Tags.Count
  FROM [StackExchange.Physics].dbo.TagSynonyms
  LEFT JOIN [StackExchange.Physics].dbo.Tags
    ON TagSynonyms.TargetTagName = Tags.TagName
),
MathTagsFixed AS (
  SELECT Tag, SUM(Count) AS Count
  FROM MathTags
  GROUP BY Tag
),
PhysicsTagsFixed AS (
  SELECT Tag, SUM(Count) AS Count
  FROM PhysicsTags
  GROUP BY Tag
)
SELECT
  MathTagsFixed.Tag,
  MathTagsFixed.Count AS MathCount,
  PhysicsTagsFixed.Count AS PhysicsCount
FROM MathTagsFixed, PhysicsTagsFixed
WHERE MathTagsFixed.Tag = PhysicsTagsFixed.Tag
ORDER BY MathTagsFixed.Tag;
--ORDER BY MathTags.Count * PhysicsTags.Count DESC;

Enter Parameters

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