Users badges ranks

0

Please login or register to vote for this query.

(click on this box to dismiss)

Italian Language Meta

Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language

WITH pd AS (
  SELECT ROW_NUMBER() OVER (PARTITION BY b.name ORDER BY b.Date ) AS pd_rank 
        , u.displayname AS pd_user, u.reputation AS pd_rep
        , b.Name AS pd_tag, b.Date AS pd_date, b.class AS pd_class
  FROM badges b
  INNER JOIN users u 
   ON b.userid = u.id  
) 



SELECT case when pd.pd_class = 1 then 'gold'
         when pd.pd_class = 2 then 'silver'
         when pd.pd_class = 3 then 'bronze'
    end as pd_metal, pd.*
FROM pd
where  pd_user = 'PatrickArtner'
ORDER BY pd.pd_class, pd.pd_rank

Enter Parameters

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