Q&A about the site for members of the workforce navigating the professional setting
with table1 as (select distinct UserId, count(name) as BadgeCount from Badges group by UserId, Name) select distinct top 100 Users.AccountId, Users.DisplayName, table1.* from Users left join table1 on Users.AccountId = table1.UserId order by BadgeCount desc