leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

1179.sql (770B)


0 SELECT id,
1 SUM(IF(month = 'Jan', revenue, NULL)) AS Jan_Revenue,
2 SUM(IF(month = 'Feb', revenue, NULL)) AS Feb_Revenue,
3 SUM(IF(month = 'Mar', revenue, NULL)) AS Mar_Revenue,
4 SUM(IF(month = 'Apr', revenue, NULL)) AS Apr_Revenue,
5 SUM(IF(month = 'May', revenue, NULL)) AS May_Revenue,
6 SUM(IF(month = 'Jun', revenue, NULL)) AS Jun_Revenue,
7 SUM(IF(month = 'Jul', revenue, NULL)) AS Jul_Revenue,
8 SUM(IF(month = 'Aug', revenue, NULL)) AS Aug_Revenue,
9 SUM(IF(month = 'Sep', revenue, NULL)) AS Sep_Revenue,
10 SUM(IF(month = 'Oct', revenue, NULL)) AS Oct_Revenue,
11 SUM(IF(month = 'Nov', revenue, NULL)) AS Nov_Revenue,
12 SUM(if(month = 'Dec', revenue, NULL)) AS Dec_Revenue
13 FROM Department
14 GROUP BY id