3

How is tag-wise reputation calculated and displayed?

Example: For the SQL Server tag we can find out total reputation here:

https://stackoverflow.com/tags/sql-server/topusers

Screenshot of top users

I tried the same in https://data.stackexchange.com with the below query, but it pulls the wrong result:

SELECT owneruserid,
       Sum(score * 10) AS post_repuation
FROM   posts
WHERE  owneruserid = 3349551
       AND posttypeid = 1
       AND tags LIKE '%sql%server%'
GROUP  BY owneruserid

Link for query: https://data.stackexchange.com/stackoverflow/query/540726

  • @Cai it always shows yourself at the end, if you have rep in that tag – rene Sep 17 '16 at 14:18
5

You're looking at the top answers, but you're querying the questions. Also as you are only looking at score, you don't have to calculate reputation. If you need that you have to join the votes table and sum indeed up and down votes.

This query is better I think:

select p.OwnerUserId as [User Link] -- is you
     , sum(p.score) as post_repuation  -- answer score
from posts p  -- answers
inner join posts q on q.id = p.parentid -- link answer to question
where p.OwnerUserId = 3349551  -- 
and p.posttypeid = 2 -- answers
and q.tags like '%<sql-server>%' -- tags are enclosed in brackets
                                 -- and are only filled for questions
group by p.OwnerUserId

When run today it shows a score of 1898. Keep in mind that SEDE is only updated once a week.

You must log in to answer this question.

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