SELECT ENAME, JOB, SAL,
NTILE(4) OVER (ORDER BY SAL DESC NULLS LAST) 등급
FROM EMP
WHERE JOB IN ('ANALYST', 'MANAGER', 'CLERK');
ENAME | JOB | SAL | 등급
FORD | ANALYST | 3000 | 1
SCOTT | ANALYST | 3000 | 1
JONES | MANAGER | 2975 | 1
BLAKE | MANAGER | 2850 | 2
CLARK | MANAGER | 2450 | 2
MILLER | CLERK | 1300 | 3
ADAMS | CLERK | 1100 | 3