WHICH TAGS you talk about the most (by wordcount in comments) - multi user prompt, all tags

1

Please login or register to vote for this query.

(click on this box to dismiss)

(UNFINISHED) so far it's only looking at Tags for questions that you have COMMENTED on (either the question's or answer's comment)

Linguistics Meta

Q&A about the site for professional linguists and others with an interest in linguistic research and theory

select 
  UserId,
  postid,
  count(*) as [#Comments],
  sum(len(text)-len(replace(text,' ',''))) as [#Words],
  sum(len(text)) as [CmntLength],
  sum(score) as [cScore]
into #words from comments
where userid in(##UserID##)
group by userid, postid

select
  case when pt.tagid is null then 'C on A' else 'C on Q' end as [WordSource],
  userid,
  [cScore],
  isnull(pt.postid,a.parentid) as [PostID],
  [#comments],[#Words],[CmntLength],
  isnull(pt.tagid,pt2.tagid) as [tagid]
into #comments 
from #words c 
left outer join posttags pt  on c.postid=pt.postid
left outer join posts a      on c.postid=a.id
left outer join posttags pt2 on a.parentid=pt2.postid

select
  c.UserId as [User Link],
  t.TagName,
  sum(c.[#Comments]) as [#C omments],
  sum(c.[#Words]) as [# Words in Comments],
  sum(c.[CmntLength]) as [Total Length (Characters)],
  sum([cScore]) as [Comment Upvotes],
  --sum(c.[CmntLength])/sum(c.[#Words]),
  rank() over (partition by c.UserID order by sum(c.[#Words]) desc, c.UserId) as [User TagRank]
from #comments c left outer join tags t on c.tagid=t.id
group by c.UserId, t.TagName
order by sum(c.[#Words]) desc, c.UserId

select * from #comments --[TAB#2]--
--UserID: Enter one or more numeric User ID's:"Multiple ID's should be comma sepasrated."

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results