select datepart(dw, v.creationdate) [day of week] , count...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

select datepart(dw, v.creationdate) [day of week]
     , count(*) [total votes]
     , sum(case votetypeid when 1 then 1 else 0 end) [accept]
     , sum(case votetypeid when 2 then 1 else 0 end) [up votes]
     , sum(case votetypeid when 3 then 1 else 0 end) [down votes]
from posts p
inner join votes v on v.postid = p.id
where p.owneruserid = ##uid?28111##
and votetypeid in (1, 2, 3)
group by datepart(dw, v.creationdate)
order by datepart(dw, v.creationdate)

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results