Moderator election badges

1

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 bdg.[Id]   as [BadgeId],
       bdg.[Name] as [BadgeName]
  into #ModeratorElectionBadges
  from [Badges] bdg
 where bdg.[Name] in (
         'Civic Duty', 
         'Cleanup',
         'Constituent',
         'Convention',
         'Copy Editor',
         'Deputy',
         'Electorate',
         'Enthusiast',
         'Explainer',
         'Investor',
         'Marshal',
         'Organizer',
         'Quorum',
         'Refiner',
         'Reviewer',
         'Sportsmanship',
         'Steward', 
         'Strunk & White',
         'Tag Editor',
         'Yearling'
);

select distinct
       usr.[Id],
       meb.[BadgeName],
       iif(bdg.[UserId] is null, 0, 1) as [HasBadge]
  from #ModeratorElectionBadges meb
           left join
       [Badges]                 bdg on bdg.[Id] = meb.[BadgeId]
           join
       [Users]                  usr on usr.[Id] = bdg.[UserId]
 where usr.[Id] in ( ##UserIds## )
 order by meb.[BadgeName];

Enter Parameters

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