SELECT SUM(TOT_SCORE) TOT_SCORE
, MIN(TOT_SCORE) MIN_SCORE
, MIN(COMI_ID) KEEP(DENSE_RANK FIRST ORDER BY TOT_SCORE DESC) MIN_COMI_ID
, MAX(TOT_SCORE) MAX_SCORE
, MAX(COMI_ID) KEEP(DENSE_RANK LAST ORDER BY TOT_SCORE DESC) MAX_COMI_ID
FROM EXAMPLE
GROUP BY GROUP_ID
, MIN(TOT_SCORE) MIN_SCORE
, MIN(COMI_ID) KEEP(DENSE_RANK FIRST ORDER BY TOT_SCORE DESC) MIN_COMI_ID
, MAX(TOT_SCORE) MAX_SCORE
, MAX(COMI_ID) KEEP(DENSE_RANK LAST ORDER BY TOT_SCORE DESC) MAX_COMI_ID
FROM EXAMPLE
GROUP BY GROUP_ID
728x90
'Carpe Programming > oracle' 카테고리의 다른 글
[oracle] TIMESTAMP 밀리세컨드 시간 계산하기 (0) | 2012.01.19 |
---|---|
[oracle] 파티셔닝 (0) | 2012.01.19 |
[oracle] alter sql (0) | 2011.12.02 |
[oracle] random order by (0) | 2011.11.22 |
SQLPLUS 기본 SID 외의 SID로 접근하기 (0) | 2011.11.14 |