Moderator election badges


Please login or register to vote for this query.

(click on this box to dismiss)

Artificial Intelligence

Q&A for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment

select bdg.[Id]
  into #ModeratorElectionBadges
  from [Badges] bdg
 where bdg.[Name] in (
         'Civic Duty', 
         'Copy Editor',
         'Strunk & White',
         'Tag Editor',

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

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results