Q&A for ebook publishers and readers
SELECT Id, TagName, Id AS AliasId, TagName AS Alias FROM Tags WHERE NOT EXISTS ( SELECT Id FROM TagSynonyms WHERE SourceTagName=TagName AND ApprovedByUserId IS NOT NULL ) UNION SELECT Tags.Id, Tags.TagName, Alias.Id AS AliasId, Alias.TagName FROM Tags INNER JOIN TagSynonyms ON TargetTagName=TagName INNER JOIN Tags AS Alias ON Alias.TagName=SourceTagName WHERE ApprovedByUserId IS NOT NULL