Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. select emp1.name from
  2. (select emp.chief_id chief,
  3. avg(emp.salary) avsalary
  4. from employee emp
  5. where emp.chief_id is not null
  6. group by chief_id) e1,
  7. employee emp1
  8. where emp1.id=e1.chief
  9. and emp1.salary>=2*e1.avsalary;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement