SUBANGKAR

MAX_DEP_SAL

Nov 10th, 2017
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. SELECT LAST_NAME, SALARY, DEPARTMENT_ID
  3. FROM EMPLOYEES E1
  4. WHERE E1.SALARY =
  5. (
  6. SELECT MAX(E2.SALARY)
  7. FROM EMPLOYEES E2
  8. GROUP BY E2.DEPARTMENT_ID
  9. HAVING E2.DEPARTMENT_ID = E1.DEPARTMENT_ID
  10. ) ;
RAW Paste Data