Q&A for users and developers of the Cardano cryptocurrency ecosystem
SELECT u.Id AS [User Link], MAX(b.Name) AS 'One of the gold badges they have', COUNT(*) AS 'Number of gold badges' FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Class = 1 GROUP BY u.Id ORDER BY COUNT(*) DESC;