Tags: Schreibvarianten (AE/BE: o/ou)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sustainable Living

Q&A for folks dedicated to a lifestyle that can be maintained indefinitely without depleting available resources

-- Tags: Schreibvarianten (AE/BE: o/ou)

with
PostCounts as (
  select
     Tags.Id         as TagId,
     count(Posts.Id) as PostCount
  from Posts    inner join
       PostTags on Posts.Id = PostTags.PostId
                inner join
       Tags     on PostTags.TagId = Tags.Id
  group by Tags.Id
),
Variants as (
  select *
  from (select replace(TagName, 's', 'z') as vname, * from tags) as r
  where vname != tagname
)

select
  Tags.Id as [Tag Link],
  Tags.TagName,
  tc.PostCount,
  Variants.TagName,
  vc.PostCount
from
  Tags          inner join
  Variants      on Tags.tagName = Variants.vname
                inner join 
  PostCounts tc on Tags.Id = tc.TagId
                inner join
  PostCounts vc on Variants.Id = vc.TagId
order by vc.PostCount desc;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results