instruction: Tag Totals, grouped by Target Tag Synonyms.
response: SELECT TagTotals.TagName, SUM(TagTotals.Count) FROM (SELECT TagSynonyms.TargetTagName AS TagName, Tags.Count FROM Tags INNER JOIN TagSynonyms ON (Tags.TagName = TagSynonyms.SourceTagName) UNION ALL SELECT Tags.TagName, Tags.Count FROM Tags LEFT JOIN TagSynonyms ON (Tags.TagName = TagSynonyms.SourceTagName) WHERE TagSynonyms.SourceTagName IS NULL) AS TagTotals GROUP BY TagTotals.TagName