R Gold, Silver, Bronze Badgeholders


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, 
              CONVERT(VARCHAR, u.Id)) As Url,
       u.CreationDate, u.Location, 
       u.Views, u.UpVotes, u.Downvotes,             
       b.Name As BadgeName, b.Date AS BadgeDate,
           WHEN b.Class = 1 then 'gold'
           WHEN b.Class = 2 then 'silver'
           WHEN b.Class = 3 then 'bronze'
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

Switch sites:
loading Hold tight while we fetch your results