select Tag, GrandTotalViewCount = Sum(TotalViewCount) fro...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Literature Meta

Q&A about the site for scholars and enthusiasts of literature

-- Enter Query Title
-- Enter Query Description
select
  Tag,
  GrandTotalViewCount = Sum(TotalViewCount)
from
(
select
  Tag = substring(tags, v.number+1, charindex('>', tags, v.number+2)-v.number-1),
  TotalViewCount
from (
    select tags, Sum(ViewCount) TotalViewCount
    from posts
    where posttypeid=1
      and CreationDate >= '20101111' and CreationDate < '20101112'
    group by tags) p
inner join master..spt_values v on v.type='P'
  and substring(tags, v.number, 1) = '<'
) X
Group by Tag
Order by Tag Desc

Enter Parameters

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