Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT x.DEPARTMENT_ID, e1.FIRST_NAME, x.mn, x.mx
- FROM ( SELECT e2.DEPARTMENT_ID, MAX(e2.SALARY) AS mn, MIN(e2.SALARY) as mx
- FROM employees e2 GROUP BY e2.DEPARTMENT_ID ) as x
- JOIN employees e1 ON e1.DEPARTMENT_ID = x.DEPARTMENT_ID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement