Average Department Salary

How to Get the employee details whose salary is less than the average salary of the department.

Questions by nirmal1in   answers by nirmal1in

Showing Answers 1 - 18 of 18 Answers

select x.ename,x.empno,x.sal,x.deptno from emp x,
(select deptno,avg(sal) avg_sal from emp group by deptno) y
where x.deptno = y.deptno
and   x.sal    < avg_sal
order by deptno;

  Was this answer useful?  Yes

dj_dj_dj

  • Feb 26th, 2010
 

select *
from employees
where salary <
                       (select avg(salary)
                        from employees) --------     displays emp details whose salary is less
                                                                   than avg(salary).


Regards
Dharmendra Jaiswal

  Was this answer useful?  Yes

dj_dj_dj

  • May 20th, 2010
 

select emp_name, avg(salary)
from employees
group by emp_name
having avg(salary) < (Select avg(salary)
                                  from employees)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions