Skip to content

Commit 3261365

Browse files
committed
SQL
1 parent 2ebf065 commit 3261365

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

1179.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#1179
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

Comments
 (0)