Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Find employees who earn more than the average salary within their department

2776946Jun 18 2015 — edited Jun 18 2015

using the basic hr schema I came up with:

select last_name, salary, department_id from employees o

where salary >

(select avg(salary) from employees e where e.department_id =o.department_id)

;

is there another way I could possibly do this? I was thinking about possibly using a join but I can't wrap my head around it.

This post has been answered by Frank Kulash on Jun 18 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2015
Added on Jun 18 2015
8 comments
9,279 views