We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1bc883 commit 8825ef5Copy full SHA for 8825ef5
database/1179.sql
@@ -0,0 +1,16 @@
1
+/* 1179 Reformat Department Table */
2
+SELECT id,
3
+SUM(IF(month='Jan',revenue,null)) AS 'Jan_Revenue',
4
+SUM(IF(month='Feb',revenue,null)) AS 'Feb_Revenue',
5
+SUM(IF(month='Mar',revenue,null)) AS 'Mar_Revenue',
6
+SUM(IF(month='Apr',revenue,null)) AS 'Apr_Revenue',
7
+SUM(IF(month='May',revenue,null)) AS 'May_Revenue',
8
+SUM(IF(month='Jun',revenue,null)) AS 'Jun_Revenue',
9
+SUM(IF(month='Jul',revenue,null)) AS 'Jul_Revenue',
10
+SUM(IF(month='Aug',revenue,null)) AS 'Aug_Revenue',
11
+SUM(IF(month='Sep',revenue,null)) AS 'Sep_Revenue',
12
+SUM(IF(month='Oct',revenue,null)) AS 'Oct_Revenue',
13
+SUM(IF(month='Nov',revenue,null)) AS 'Nov_Revenue',
14
+SUM(IF(month='Dec',revenue,null)) AS 'Dec_Revenue'
15
+FROM Department
16
+GROUP BY id;
0 commit comments