select sum(score) AS score , case when p.posttypeid = 1 t...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Gardening and Landscaping Meta

Q&A about the site for gardeners and landscapers

select sum(score) AS score
       , case when p.posttypeid = 1 then 'Q' else 'A' end as QA
       , p.owneruserid as uid
       , count(*) as upv
       , 0 as downv
from posts p 
inner join votes v on v.postid = p.id
where v.creationdate between getdate() and Dateadd(ww, -3, getdate())
and v.votetypeid = 2
group by p.posttypeid,  p.owneruserid

Enter Parameters

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