My question..
how to write query to display the employee who are getting more salary then the average salary to the department_number from department table.
thanks in advance...
Hmmm, no create table, no sample data, no expected output!
It really, really, really helps us ensure we're giving you the correct answer if you provide these details!
So here's what I think you're looking for:
select employee_id, salary from (
select e.*, avg(salary) over (partition by department_id) d_avg
from hr.employees e
where department_id = 60
)
where salary > d_avg;
EMPLOYEE_ID SALARY
103 9,000
104 6,000