select usertagexp.userid as userid, avg(usertagexp.tagexp...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Literature

Q&A for scholars and enthusiasts of literature

select usertagexp.userid as userid, avg(usertagexp.tagexp) as cumu_depth, avg(usertagfocal.tag_count)as knowtag_avgfreq,
count(distinct usertagfocal.tagid) as knowntagbreadth, usertagfocal.month as month
from

(select UserList.uid as userid,  cast( count(pt.TagId) as numeric) as tag_count, pt.TagId as tagid, datediff(month,cast('2015-03-01' as datetime), p.CreationDate) as month

from Tags t, Posts p,  PostTags pt,

(select p.OwnerUserId as uid 
from Posts p,  PostTags pt, Users u
where p.OwnerUserId=u.Id and p.Id=pt.PostId
and (pt.TagId=100570 or pt.TagId=40102 or pt.TagId=109466 or pt.TagId=116033 or pt.TagId=113994 or pt.TagId=24100 or pt.TagId=99347 or pt.TagId=132868) 
and p.PostTypeid=1
and p.CreationDate>=cast('2015-03-01' as datetime) 
and p.CreationDate<=cast('2017-03-31' as datetime) 
group by p.OwnerUserId
) UserList

where UserList.uid=p.OwnerUserId and p.PostTypeid=1 and pt.PostId = p.Id and pt.TagId = t.Id /*pt.*/
      and p.CreationDate>=cast('2015-03-01' as datetime) and p.CreationDate<=cast('2017-03-31' as datetime)
group by UserList.uid, pt.TagId, datediff(month,cast('2015-03-01' as datetime), p.CreationDate)
) usertagfocal,

(select UserList.uid as userid, pt.TagId as tagid, cast(count(p.Id) as numeric) as tagexp

from Tags t, Posts p,  PostTags pt,

(select p.OwnerUserId as uid 
from Posts p,  PostTags pt, Users u
where p.OwnerUserId=u.Id and p.Id=pt.PostId
and (pt.TagId=100570 or pt.TagId=40102 or pt.TagId=109466 or pt.TagId=116033 or pt.TagId=113994 or pt.TagId=24100 or pt.TagId=99347 or pt.TagId=132868) 
and p.PostTypeid=1
and p.CreationDate>=cast('2015-03-01' as datetime) 
and p.CreationDate<=cast('2017-03-31' as datetime) 
group by p.OwnerUserId
) UserList

where UserList.uid=p.OwnerUserId and p.PostTypeid=1 and pt.PostId = p.Id and pt.TagId = t.Id
      and p.CreationDate>=cast('2015-03-01' as datetime) and p.CreationDate<=cast('2017-03-31' as datetime)
group by UserList.uid, pt.TagId
) usertagexp

where usertagexp.userid = usertagfocal.userid and usertagexp.tagid=usertagfocal.tagid
group by usertagexp.userid , usertagfocal.month

Enter Parameters

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