What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

How can I distinguish between the levels of badges for a particular tag, say , querying SEDE?

For example, Mr. Jon Skeet has all the gold, silver and bronze badges for LINQ, so the query

select *
from Badges b with (nolock)
where
    b.Name = 'linq'
and b.UserId = 22656

returns 3, with no distinction between them.

Is it possible to include such information into the dump, for example, keep a unique badge ID (40 for the gold badge)?

share|improve this question
4  
You can deduce that he earned the bronze badge first and the gold one last. –  NullUserException อ_อ Dec 2 '11 at 22:45
    
But yeah, currently there's no distinction between them in the datadump. –  NullUserException อ_อ Dec 2 '11 at 22:45

1 Answer 1

up vote 2 down vote accepted

It's too bad, but I guess the only thing you can do is this Data.SE query:

WITH linqbadges
     AS (SELECT Rank() OVER (PARTITION BY b.userid ORDER BY b.DATE) rn,
                b.userid,
                b.DATE
         FROM   badges b
         WHERE  b.name = 'linq')
SELECT u.displayname,
       linqbadges.DATE AS date_earned,
       CASE rn
         WHEN 1 THEN 'bronze linq'
         WHEN 2 THEN 'silver linq'
         WHEN 3 THEN 'gold linq'
       END             AS badge
FROM   linqbadges
       INNER JOIN users u
         ON linqbadges.userid = u.id
ORDER BY
        displayname,
        date_earned

The real trouble is that you can't tell a tag badge from a regular badge.

share|improve this answer
2  
A tag badge has a lowercase first letter, and a regular badge has a capital. Not the coolest to rely on, for sure... –  corsiKa Dec 13 '12 at 20:18
    
@corsiKa yep you're right. Badge Per User –  Some Helpful Commenter Dec 13 '12 at 22:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .