Advertisement
VoronVU

Untitled

Mar 27th, 2015
1,235
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.   l.LAB_NAME,
  3.   l.SALARY,
  4.   d.DEP_NAME
  5. FROM
  6.   LABORING l,
  7.   DEPARTAMENT d,
  8.   (SELECT
  9.     MAX(l.SALARY) AS SALARY_MAX
  10.   FROM
  11.     LABORING l,
  12.     DEPARTAMENT d
  13.   WHERE l.DEP_ID = d.DEP_ID
  14.     GROUP BY l.DEP_ID) sq
  15. WHERE l.SALARY = sq.SALARY_MAX
  16.   AND l.DEP_ID = d.DEP_ID
Advertisement
RAW Paste Data Copied
Advertisement