Top gold-badge earners and their gold badges

0

Please login or register to vote for this query.

(click on this box to dismiss)

Engineering

Q&A for professionals and students of engineering

select top 100
  users.id as [User Link],
  a.number,
  Badges.Name
from
  Badges inner join Users on Badges.UserId = Users.Id
  inner join
  (select 
    users.id as userid,
    Count(*) as number
  from
    Badges inner join Users on Badges.UserId = Users.Id
  where
    Name like ('Copy Editor') or
    Name like ('Electorate') or
    Name like ('Famous Question') or
    Name like ('Fanatic') or
    Name like ('Great Answer') or
    Name like ('Great Question') or
    Name like ('Legendary') or
    Name like ('Marshal') or
    Name like ('Populist') or
    Name like ('Publicist') or
    Name like ('Reversal') or
    Name like ('Stellar Question') or
    Name like ('Steward') or
    Name like ('Unsung Hero')
  group by
    users.id) a
  on a.userid = users.id
   where
    Name like ('Copy Editor') or
    Name like ('Electorate') or
    Name like ('Famous Question') or
    Name like ('Fanatic') or
    Name like ('Great Answer') or
    Name like ('Great Question') or
    Name like ('Legendary') or
    Name like ('Marshal') or
    Name like ('Populist') or
    Name like ('Publicist') or
    Name like ('Reversal') or
    Name like ('Stellar Question') or
    Name like ('Steward') or
    Name like ('Unsung Hero')
order by a.number desc, users.displayname asc, badges.name asc

Enter Parameters

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