-
sub query
hi all,
i am new member to this site
i have a table consisting of columns EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO
i want add the salary of all the employess by their job title
and i want to display the maximum value of the added salaries and the job name
-
What do you mean 'add the salary of all the employess by their job title'? Is column sal for salary?
-
here is the immediate workaround
select job, sum(sal) from emp group by job having sum(sal)=(select max(sum(sal)) from emp group by job)
also check with analytical functions to achieve same output.
-
thank u very much its working
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|