oracle PIVOT, UNPIVOT
행을 열로열을 행으로 WITH T AS ( SELECT 'AA' AS KEY1, 'BB' AS KEY2, 10 AS VAL1, 20 AS VAL2 FROM DUAL UNION ALL SELECT 'CC' AS KEY1, 'DD' AS KEY2, 30 AS VAL1, 40 AS VAL2 FROM DUAL )SELECT KEY1 AS KEY_, VAL1 AS VAL_ FROM T UNPIVOT (KEY1 FOR G IN (KEY1))UNION ALLSELECT KEY2, VAL2 FROM T UNPIVOT (KEY2 FOR G IN (KEY2)) ->
2016.07.29