oracle11g 行专列

----------- 行转列 start
select * from(
select sum(d.acu) acu, sum(d.pcu) pcu, sum(d.pay) pay, sum(d.expend) expend
from game_kpi_day d,tmp_game_list g
where d.game_id = g.id
and game_id = 4
and d.log_date between to_date('2010-01-01','yyyy-mm-dd') and to_date('2010-01-10','yyyy-mm-dd') )
unpivot(
kpi_values for kpi_name in("ACU", "PCU", "PAY", "EXPEND")
)
----------- 行转列 end
 

你可能感兴趣的:(oracle11g)