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 <= 4)
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 <= 4)
'SQL' 카테고리의 다른 글
ORACLE 행을 열로 , 열을 행으로 (0) | 2013.01.29 |
---|---|
oracle exists vs in (0) | 2013.01.29 |
세로 데이터를 가로로 변환 (0) | 2013.01.23 |
wm_concat 이 안되는 환경(여러개의 레코드를 하나의 필드로) (0) | 2013.01.13 |
Oracle의 숨겨진 함수 wm_concat () - 한 컬럼에 데이터 콤마로 엮기(Clob) (0) | 2012.11.23 |