[ORACLE] FIRST, LAST (최대, 최소값을 가진 로우 추출)
FIRST, LAST (최대, 최소값을 가진 로우 추출) - 최대, 최소값을 가진 로우를 추출한다. - 자체로는 함수가 아니며 분석 함수와 같이 사용하는 키워드이다. [구문 형식] 집계 함수 KEEP ( 함수 FIRST[LAST] ORDER BY expr [ASC | DESC] ) OVER ( PARTITION BY expr .... ) ☞ 부서별 최대급여, 최소급여 select dept , max(salary) , min(salary) from ( select 10 dept, 100 id, 39000 salary from dual union all select 20 dept, 101 id, 30000 salary from dual union all select 20 dept, 102 id, 9000 s..
더보기