oracle行轉列

SELECT *
FROM (SELECT t.parent_group,
t.country,
t.project_num
FROM RPT_GP_COUNTRY t
where t.parent_group is not null
and t.rpt_type = 0)
PIVOT (
SUM(project_num) --<-- pivot_clause
FOR parent_group --<-- pivot_for_clause
IN ('中電建','中石化') --<-- pivot_in_clause
)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章