select qeasy.userId as userId, avg(qeasy.sum_easy) as sum...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Interpersonal Skills

Q&A for people looking to improve their interpersonal communication skills

select qeasy.userId as userId, avg(qeasy.sum_easy) as sum_easy, avg(qeasy.mean_easy) as mean_easy, datediff(month,cast('2015-03-01' as datetime), qeasy.qdate) as month

from 

(select max(qlist.uid) as userId,  avg(tageasiness.tag_easy) as mean_easy,  sum(tageasiness.tag_easy) as sum_easy, max(qlist.qdate) as qdate

from PostTags pt,

(select distinct t.Id as tid, sum(posttagm1.tagc) / max(cast(t.Count as numeric)) as tag_easy
 /* (select distinct t.Id as tid, sum(posttagm1.tagc) as tag_easy */
from Tags t, PostTags pt,

(select distinct pt.PostId as pid, cast((count(pt.TagId)-1) as numeric )  as tagc
from PostTags pt
group by pt.PostId) posttagm1 

where t.Id=pt.TagId and pt.PostId=posttagm1.pid and t.Count > 1
group by t.Id
) tageasiness,

(select p.Id as pid, userlist.uid as uid, p.CreationDate as qdate

from PostsWithDeleted 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=2751) 
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.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 /* and (pt.TagId=2751) */

) qlist

where tageasiness.tid=pt.TagId and pt.PostId=qlist.pid
group by qlist.pid
) qeasy

group by qeasy.userId, datediff(month,cast('2015-03-01' as datetime), qeasy.qdate)

Enter Parameters

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