ORACLE ROLLUP 시 정렬 문제
원본 출처 : http://www.gurubee.net/article/54382 1234567891011121314151617181920WITH T AS ( SELECT 'A' COL1, 6 COL2, 40 COL3 FROM DUAL UNION ALL SELECT 'A' , 6 , 20 FROM DUAL UNION ALL SELECT 'B' , 1 , 2 FROM DUAL UNION ALL SELECT 'B' , 1 , 2 FROM DUAL ) SELECT DECODE(1 , GROUPING(COL1), '총합계' , GROUPING(ROWNUM), COL1 || '중간합계' , COL1) COL , COL1 , SUM(COL2) COL2 , SUM(COL3) COL3 FROM T GROUP BY ROL..