City_name
|
Month_no(月)
|
Qut__qty(台)
|
杭州
|
9
|
100
|
杭州
|
10
|
120
|
上海
|
9
|
130
|
上海
|
10
|
140
|
…..
|
…
|
…
|
(select fpc.partno,
sum ( decode ( fpc.org_id,21385 ,fpc.qty,0))as qty1 ,
sum ( decode ( fpc.org_id,21383 ,fpc.qty,0))as qty2,
fpc.qty,fpc.consumption_date
from fact_parts_consumption fpc
group by fpc.partno,fpc.qty,fpc.consumption_date)
( select fpc.partno, fpc.qty, fpc.org_id,
nvl (sum ( case when fpc.org_id = 21383 then fpc.qty end ) ,0)as Qty21383 ,
nvl (sum ( case when fpc.org_id = 21385 then fpc.qty end ),0)as Qty21385
from fact_parts_consumption fpc
group by fpc.partno, fpc.qty, fpc.org_id)