Better Score for Tag Highscore

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 c.*
, ((c.accounted_post_quantity / 20.0) * c.post_repuation) as better_score   
from
(select p.OwnerUserId as [User Link] -- is you
     , sum(p.score) as post_repuation  -- answer score
     , count(p.parentid) as post_quantity
     , case when count(p.parentid) > 20 then 20 else count(p.parentid) end as accounted_post_quantity
from posts p  -- answers
inner join posts q on q.id = p.parentid -- link answer to question
and p.posttypeid = 2 -- answers
and q.tags like '%<##tag##>%' -- tags are enclosed in brackets
                                 -- and are only filled for questions
                                 
group by p.OwnerUserId) c
order by better_score DESC

Enter Parameters

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