- MAX() KEEP(DENSE_RANK FIRST[LAST] ORDER BY)
- MIN() KEEP(DENSE_RANK FIRST[LAST] ORDER BY)


SELECT deptno
     , MAX(sal) max_sal
     , MAX(empno) KEEP(DENSE_RANK LAST  ORDER BY sal)      max_e -- 같다
     , MAX(empno) KEEP(DENSE_RANK FIRST ORDER BY sal desc) max_e -- 같다
     , MIN(empno) KEEP(DENSE_RANK FIRST ORDER BY sal desc) max_e -- 같다

     , MIN(sal) min_sal
     , MIN(empno) KEEP(DENSE_RANK FIRST ORDER BY sal) min_e
  FROM emp
 GROUP BY deptno
 ORDER BY deptno;



    DEPTNO    MAX_SAL      MAX_E    MIN_SAL      MIN_E
---------- ---------- ---------- ---------- ----------
        10       5000       7839       1100       1111 
        20       3000       7902        800       7369 
        30       2850       7698        950       7900