[Oracle] 버전별 Group By에서 문자열 합치기 (여러 ROW를 한줄로)
WITH tbl (type, name, code) AS ( SELECT 'STRING', 'BBB', '1' FROM dual UNION ALL SELECT 'INTEGER', '222', '1' FROM dual UNION ALL SELECT 'STRING', 'CCC', '2' FROM dual UNION ALL SELECT 'INTEGER', '333', '2' FROM dual UNION ALL SELECT 'STRING', 'AAA', '0' FROM dual UNION ALL SELECT 'STRING', 'DDD', '3' FROM dual UNION ALL SELECT 'INTEGER', '111', '0' FROM dual ) SELECT type , SUBSTR(XMLAgg(XMLEle..
행과 열 바꾸기
문제)아래 데이터를 세로로 출력해 봅시다. with my_table as( SELECT MAX(GUBUN) GUBUN, MAX(M) M, MAX(M2) M2, MAX(DIV) DIV, MAX(PER) PER FROM ( SELECT '멋쟁이' GUBUN, '' M, '' M2, '' DIV, '' PER FROM DUAL UNION ALL SELECT '' GUBUN, '3630' M, '' M2, '' DIV, '' PER FROM DUAL UNION ALL SELECT '' GUBUN, '' M, '2847' M2, '' DIV, '' PER FROM DUAL UNION ALL SELECT '' GUBUN, '' M, '' M2, '783' DIV, '' PER FROM DUAL UNION ALL S..