가로를 세로로
SELECT NAME, ID, FIRST_QUARTER, SECOND_QUARTER, THIRD_QUARTER, FOURTH_QUARTER FROM PINO93.SALETB_SALE SELECT NAME, ID, DECODE(LV, 1, FIRST_QUARTER, 2, SECOND_QUARTER, 3, THIRD_QUARTER, 4, FOURTH_QUARTER) DATA FROM ( SELECT NAME, ID, FIRST_QUARTER, SECOND_QUARTER, THIRD_QUARTER, FOURTH_QUARTER FROM PINO93.SALETB_SALE ), ( SELECT LEVEL LV FROM DUAL CONNECT BY LEVEL
더보기
세로 데이터를 가로로 변환
) 세로를 가로의 데이터로 만들기 /* Formatted on 2010/10/07 14:11 (Formatter Plus v4.8.8) */ WITH tmp AS (SELECT '1' AS col1, 'A' AS col2 FROM DUAL UNION ALL SELECT '2' AS col1, '가' AS col2 FROM DUAL UNION ALL SELECT '1' AS col1, 'B' AS col2 FROM DUAL UNION ALL SELECT '1' AS col1, 'C' AS col2 FROM DUAL) SELECT col1, LTRIM (SYS_CONNECT_BY_PATH (col2, ','), ',') AS col1 FROM (SELECT col1, col2, ROW_NUMBER () OV..
더보기