Self-evaluation sample questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Emacs

Q&A for those using, extending or developing Emacs

with vote_split as
(select isnull(p.ParentId, p.Id) page,
       count(distinct u.Id) up,
       count(distinct d.Id) down,
       count(distinct l.Id) a_up,
       count(distinct h.Id) a_down
from Posts p
     left outer join Votes u on p.Id = u.PostId and u.VoteTypeId = 2
     left outer join Votes d on p.Id = d.PostId and d.VoteTypeId = 3
     left outer join PostFeedback l on p.Id = l.PostId and l.VoteTypeId = 2
     left outer join PostFeedback h on p.Id = h.PostId and h.VoteTypeId = 3
group by isnull(p.ParentId, p.Id)
)

select top ##SampleSize?5##
       page as [Post Link], 
       up, down, up-down score, 
       round(((up + 1.9208) / (up + down) - 
        1.96 * SQRT((up * down) / (up + down) + 0.9604) / 
        (up + down)) / (1 + 3.8416 / (up + down)), 2)
       AS wilson,
       a_up, a_down, a_up-a_down a_score, 
       round(((a_up + 1.9208) / (a_up + a_down) - 
        1.96 * SQRT((a_up * a_down) / (a_up + a_down) + 0.9604) / 
        (a_up + a_down)) / (1 + 3.8416 / (a_up + a_down)), 2) 
       AS a_wilson, 
       ViewCount
from vote_split
     join Posts on Id = page
where a_up + a_down > ##MinAnonFeedback?5##
      and up + down > 0
      and CreationDate > getdate() - ##DaysAgo?90##
      and PostTypeId = 1
      and AnswerCount > 0
order by newid();

Enter Parameters

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