Anonymous votes and views (log view)


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with anon_votes as (
  select count(case VoteTypeId when 2 then 1 end) upvotes,
         count(case VoteTypeId when 3 then 1 end) downvotes,
         isnull(ParentId, PostId) PostId
  from PostFeedback pf
       join Posts p on PostId = p.Id
  group by isnull(ParentId, PostId)
  select log(upvotes+downvotes) anon_feedback, log(avg(ViewCount)) views
from anon_votes
     join Posts p on PostId = p.Id
where upvotes+downvotes <= 1000
group by upvotes+downvotes
order by upvotes+downvotes

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results