R Gold, Silver, Bronze Badgeholders

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT u.Id, u.DisplayName, u.Reputation, 
       CONCAT('https://stackoverflow.com/users/', 
              CONVERT(VARCHAR, u.Id)) As Url,
       u.CreationDate, u.Location, 
       u.Views, u.UpVotes, u.Downvotes,             
       b.Name As BadgeName, b.Date AS BadgeDate,
       CASE 
           WHEN b.Class = 1 then 'gold'
           WHEN b.Class = 2 then 'silver'
           WHEN b.Class = 3 then 'bronze'
       END
       
FROM users u
JOIN badges b ON u.Id = b.UserId AND TagBased = 1
JOIN tags t ON t.TagName = b.Name AND t.TagName = 'r'

ORDER BY u.Reputation DESC, b.Class

Enter Parameters

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