select b.UserId as userid, b.Name as badge_name, count(b....

0

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 as userid, b.Name as badge_name, count(b.Id) as badge_frequency

from Badges b,

(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=19195) 
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  UserList.uid=b.UserId and b.Date<=cast('2015-03-01' as datetime) and (b.Name = 'Curious' or b.Name = 'Inquisitive' or b.Name = 'Socratic' or
                                  b.Name = 'Nice Question' or b.Name = 'Good Question' or b.Name = 'Great Question' or
                                  b.Name = 'Popular Question' or b.Name = 'Notable Question' or b.Name = 'Famous Question' or
                                  b.Name = 'Favorite Question' or b.Name = 'Stellar Question' or
                                  b.Name = 'Explainer' or b.Name = 'Refiner' or b.Name = 'Illuminator' or
                                  b.Name = 'Nice Answer' or b.Name = 'Good Answer' or b.Name = 'Great Answer' or
                                  b.Name = 'Generalist' or b.Name = 'Guru')
/* where  UserList.uid=b.UserId and (b.Class = 1) */
group by b.UserId, b.Name

Enter Parameters

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