# Thread: List all the job groups who average salary exceeds that of managers.

1. ## List all the job groups who average salary exceeds that of managers.

List all the job groups who average salary exceeds that of managers.

Empno ename job manager hiredate salary deptno commission
7369 smith clerk 7902 12/1/1982 1200 20 null
7499 allen salesman 7698 2/20/1981 1501 30 null
7521 ward salesman 7698 2/22/1981 1600 30 160
7698 black manager 7999 5/1/1981 3850 30 385
7902 ford analyst 7566 12/1/1981 3000 10 300
7688 jones analyst 7698 10/10/2008 4500 10 450
7689 martin clerk 7698 12/12/2004 4525 20 453
7999 scott ceo null 1/1/2001 9999 30 1000
7466 tiger manager 7999 1/1/2004 6500 10 650

2. ## Re: List all the job groups who average salary exceeds that of managers.

What is the code that you are working on ?

3. ## Re: List all the job groups who average salary exceeds that of managers.

Hi Jai,

The query can be like

Select AvgSal, job from (
select avg(salary) AvgSal, job from [tablename] group by job
) as vw where job<>'manager'
and AvgSal > (Select Avg(Salary) from [tablename] where job='manager')

---V V---
Vikas Vaidya

4. ## Re: List all the job groups who average salary exceeds that of managers.

Select job,avg(salary)from employees where (avg(salary)>(select salary from employees where job=manager) and job not equals 'manager') group by job.

5. ## Re: List all the job groups who average salary exceeds that of managers.

Select job,avg(salary)from employees where (avg(salary)>(select salary from employees where job=manager) and job not equals 'manager') group by job;

6. ## Re: List all the job groups who average salary exceeds that of managers.

Select job, avgsal
From (Select Avg (sal) avgsal, job
From emp
Group By job),
(Select sal msal
From emp
Where job = 'MANAGER')
Where avgsal > msal And job != 'MANAGER'

7. ## Re: List all the job groups who average salary exceeds that of managers.

select job, avg(sal ) from emp where job != "MANAGER" group by job
having avg(sal ) > ( select avg(sal) from emp where job = "MANAGER" )

8.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•