select Tag = substring(tags, v.number+1, charindex('>', t...

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 = substring(tags, v.number+1, charindex('>', tags, v.number+2)-v.number-1),
  CountViewCount,
  ViewCount
from (
    select tags, ViewCount, ViewCount*Count(*) CountViewCount
    from posts
    where posttypeid=1
    group by tags, ViewCount) p
inner join master..spt_values v on v.type='P'
  and substring(tags, v.number, 1) = '<'

Enter Parameters

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