Sample for 7837475

0

Please login or register to vote for this query.

(click on this box to dismiss)

Enter Query Description

Anime and Manga

Q&A for anime and manga fans

-- Enter Query Title
-- Enter Query Description

SELECT MONTH([creationdate]) AS mo, 
       SUM(CASE 
         WHEN YEAR([creationdate]) = YEAR(Dateadd(YEAR, -2, Getdate())) THEN score
         ELSE 0 
       END)          AS y1, 
       SUM(CASE 
         WHEN YEAR([creationdate]) = YEAR(Dateadd(YEAR, -1, Getdate())) THEN score 
         ELSE 0 
       END)           AS y2, 
       SUM(CASE 
         WHEN YEAR([creationdate]) = YEAR(Getdate()) THEN score 
         ELSE 0 
       END)           AS y3 
FROM   posts 

where owneruserid = 22656
GROUP BY MONTH([creationdate])

Enter Parameters

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