반응형
WITH W_TEST AS
(
SELECT 1 AS NO, 'A' AS VAL FROM DUAL
UNION ALL SELECT 2 AS NO, 'C' AS VAL FROM DUAL
UNION ALL SELECT 3 AS NO, 'B' AS VAL FROM DUAL
)
SELECT (SELECT MAX(VAL) FROM W_TEST) AS VAL_1
, (SELECT MAX(VAL) KEEP (DENSE_RANK FIRST ORDER BY NO DESC) FROM W_TEST) AS VAL_2
FROM DUAL
;
----- 결과 -----
VAL_1 VAL_2
C B
'전산Tip > Oracle' 카테고리의 다른 글
[ORACLE] 통계정보 조회 (0) | 2019.05.13 |
---|---|
[ORACLE] 스키마 이행 검증 (0) | 2019.04.24 |
테이블 이관 후 건수 및 값 검증 (0) | 2019.04.17 |