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],
       bdg.[Name]
  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',
         'Sportsmanship',
         'Strunk & White',
         'Tag Editor',
         'Reviewer',
         'Steward', 
         'Yearling'
);

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

Enter Parameters

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