Participation badges for the users from a list (with breakdown by specific badges)

1

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Different

Q&A for power users of Apple hardware and software

With prelim As 
(
   Select u.Id As Username, 
---      floor(10+0.5*u.Reputation/1000-0.5*abs(u.Reputation/1000-20)) As CappedRep, 
      Count(distinct b.Name) As BadgeCount, 
      u.LastAccessDate As LastAccess,
      SUM(case when b.Name = 'Constituent' then 1 else 0 end) AS Constituent,
      SUM(case when b.Name = 'Convention' then 1 else 0 end) AS Convention,
      SUM(case when b.Name = 'Enthusiast' then 1 else 0 end) AS Enthusiast,
      SUM(case when b.Name = 'Investor' then 1 else 0 end) AS Investor,
      SUM(case when b.Name = 'Quorum' then 1 else 0 end) AS Quorum,
      SUM(case when b.Name = 'Yearling' then 1 else 0 end) AS Yearling
   From Users u
   Inner Join Badges b On b.UserId = u.Id
   Where u.Reputation >= ##min?1000## and 
     u.Id in (##list?63475,68109##) and
     b.Name in (
         'Constituent',
         'Convention',
         'Enthusiast',
         'Investor',
         'Quorum',
         'Yearling')
  Group By u.Id, u.Reputation, u.LastAccessDate
) 

Select Username as [User Link], BadgeCount, 
  Constituent, Convention, Enthusiast, 
  Investor, Quorum, Yearling

From prelim 
Order By BadgeCount desc

Enter Parameters

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