select b.UserId, avg(badgercomplexity.freq) as avg_tag_ba...


Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

select b.UserId, avg(badgercomplexity.freq) as avg_tag_based_badge_freq, sum(badgercomplexity.freq) as sum_tag_based_badge_freq
from Badges b,

(select b.Name as bname, cast(count(b.Id) as numeric) as freq
from Badges b
where b.TagBased = 1
group by b.Name
) badgercomplexity,

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

where badgercomplexity.bname=b.Name and b.UserId=userlist.uid

group by b.UserId
order by b.UserId

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results