- 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
KEEP 집계함수 사용법
|
2016.02.13 12:06:40
|
2018.08.08 22:37:00
|
407
|
Aiden
Total of Attached file
0.00 Bytes of 0 files
2016.09.21
2016.09.07
2016.07.07
2016.02.16
2016.02.13
2016.02.13
2016.02.12
2016.02.12
2016.01.26
2016.01.24
2016.01.24