All the views (log scaled)


Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

with question_score as (
select power(log10(ViewCount), 5) ask_views, 
       OwnerUserId UserId, 
       Id PostId
from Posts
where PostTypeId = 1
      and AnswerCount > 0
      and Score > 0
      and CommunityOwnedDate is null
group by OwnerUserId, Id, ViewCount, AnswerCount

answer_score as (
select power(log10(q.ViewCount), 5) answer_views, 
       a.OwnerUserId UserId, 
       a.Id PostId
from Posts q
     join Posts a on (q.Id = a.ParentId)
where a.Score > 0
      and a.CommunityOwnedDate is null
group by a.OwnerUserId, a.Id, q.ViewCount, a.Score

select OwnerUserId as [User Link],
       round(sum(ask_views), 0) ask_score,
       sum(q.ViewCount) q_views,
       round(sum(answer_views), 0) answer_score,
       sum(a.ViewCount) a_views,
       round(sum(isnull(answer_views, 0)) 
             + isnull(sum(ask_views), 0), 0) total_score
from question_score q
     full outer join Posts p on (q.PostId = p.Id)
     full outer join answer_score a on (p.Id = a.PostId)
where OwnerUserId in (##UserId##)
group by OwnerUserId

Enter Parameters

Switch sites
loading Hold tight while we fetch your results