반응형
WITH A AS (
SELECT 'A' AS AA FROM DUAL UNION ALL
SELECT 'B' AS AA FROM DUAL UNION ALL
SELECT 'C' AS AA FROM DUAL UNION ALL
SELECT 'D' AS AA FROM DUAL UNION ALL
SELECT 'E' AS AA FROM DUAL UNION ALL
SELECT 'F' AS AA FROM DUAL
)
SELECT MAX(A),MAX(B),MAX(C),MAX(D),MAX(E),MAX(F)
FROM (
SELECT DECODE(AA,'A',AA,NULL) AS A,
DECODE(AA,'B',AA,NULL) AS B,
DECODE(AA,'C',AA,NULL) AS C,
DECODE(AA,'D',AA,NULL) AS D,
DECODE(AA,'E',AA,NULL) AS E,
DECODE(AA,'F',AA,NULL) AS F
FROM A
);
반응형
'DB > 오라클' 카테고리의 다른 글
[오라클] 가로를 세로로 변경 (CONNECT BY) (0) | 2014.10.28 |
---|---|
[오라클] SERVEROUTPUT 사이즈SIZE 조정 (0) | 2014.10.24 |
[오라클] SELECT 시 숫자 포맷 쉼표처리 (0) | 2014.10.21 |
[오라클] SELECT 를 이용한 쿼리 만들기 (0) | 2014.10.07 |
[오라클] ORACLE 날짜 쿼리 (0) | 2014.10.06 |
WRITTEN BY
,