select userlist.uid, COUNT( distinct p.Id) as q_count, av...


Please login or register to vote for this query.

(click on this box to dismiss)

Role-playing Games

Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games

select userlist.uid, COUNT( distinct p.Id) as q_count, avg(p.Score) as q_score, avg(p.ViewCount) as q_view, avg(p.AnswerCount) as q_answer,
cast (count(pt.TagId)/count( distinct p.Id)as numeric) as q_avgtag, avg(p.CommentCount) as q_comment, avg(p.FavoriteCount) as q_favorite,
datediff(month,cast('2015-03-01' as datetime), p.CreationDate) as month

from 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 p.PostTypeid=1
and p.CreationDate>=cast('2012-07-01' as datetime) 
and p.CreationDate<=cast('2015-08-01' as datetime) 
group by p.OwnerUserId
) userlist

where userlist.uid=p.OwnerUserId and p.CreationDate>=cast('2015-03-01' as datetime) and p.CreationDate<=cast('2017-03-31' as datetime) and p.PostTypeId=1 and p.Id=pt.PostId
group by userlist.uid, datediff(month,cast('2015-03-01' as datetime), p.CreationDate)

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results