Q&A for ebook publishers and readers
SELECT IsNUll(TargetTagName, TagName) AS MainTag , TagName as TagName , Tags.Id as TagId FROM Tags LEFT JOIN TagSynonyms ON SourceTagName=TagName