historic language popularity

0

Please login or register to vote for this query.

(click on this box to dismiss)

Genealogy and Family History Meta

Q&A about the site for expert genealogists and people interested in genealogy or family history

select TagName,
  (
    select count(TagName)
    from Tags
    join PostTags on PostTags.TagId = Tags.Id
    join Posts on Posts.Id = PostTags.PostId
    where Posts.CreationDate > DATEADD(year, -6, GetDate())
      and Posts.CreationDate < DATEADD(year, -5, GetDate())
    and TagName = allTheTags.TagName
    group by Tags.TagName
  ) as '2008',
  (
    select count(TagName)
    from Tags
    join PostTags on PostTags.TagId = Tags.Id
    join Posts on Posts.Id = PostTags.PostId
    where Posts.CreationDate > DATEADD(year, -5, GetDate())
      and Posts.CreationDate < DATEADD(year, -4, GetDate())
    and TagName = allTheTags.TagName
    group by Tags.TagName
  ) as '2009',
  (
    select count(TagName)
    from Tags
    join PostTags on PostTags.TagId = Tags.Id
    join Posts on Posts.Id = PostTags.PostId
    where Posts.CreationDate > DATEADD(year, -4, GetDate())
      and Posts.CreationDate < DATEADD(year, -3, GetDate())
    and TagName = allTheTags.TagName
    group by Tags.TagName
  ) as '2010',
  (
    select count(TagName)
    from Tags
    join PostTags on PostTags.TagId = Tags.Id
    join Posts on Posts.Id = PostTags.PostId
    where Posts.CreationDate > DATEADD(year, -3, GetDate())
      and Posts.CreationDate < DATEADD(year, -2, GetDate())
    and TagName = allTheTags.TagName
    group by Tags.TagName
  ) as '2011',
  (
    select count(TagName)
    from Tags
    join PostTags on PostTags.TagId = Tags.Id
    join Posts on Posts.Id = PostTags.PostId
    where Posts.CreationDate > DATEADD(year, -2, GetDate())
      and Posts.CreationDate < DATEADD(year, -1, GetDate())
    and TagName = allTheTags.TagName
    group by Tags.TagName
  ) as '2012',
  (
    select count(TagName)
    from Tags
    join PostTags on PostTags.TagId = Tags.Id
    join Posts on Posts.Id = PostTags.PostId
    where Posts.CreationDate > DATEADD(year, -1, GetDate())
    and TagName = allTheTags.TagName
    group by Tags.TagName
  ) as '2013'

from Tags allTheTags
where allTheTags.TagName like 'windows-phone'
order by allTheTags.TagName

Enter Parameters

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