Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select emp1.name from
- (select emp.chief_id chief,
- avg(emp.salary) avsalary
- from employee emp
- where emp.chief_id is not null
- group by chief_id) e1,
- employee emp1
- where emp1.id=e1.chief
- and emp1.salary>=2*e1.avsalary;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement