-
Department wise max salary
I have employee table, with empno, empname, deptno, sal fields.
What I want is I want to get department wise max salary.
my table data would be
empno empname deptno sal
1 vipul 2 200
2 hitesh 2 300
3 raj 2 100
4 mac 1 200
5 alex 1 300
6 mo 3 100
so result should be
deptno empno sal
1 5 300
2 2 300
2 6 100
any ideas?
Question asked by visitor vipul
-
Junior Member
Re: Department wise max salary
select deptno,max(sal) from emp
group by deptno
-
Re: Department wise max salary
Its so simple
select deptno,max(sal) from emp group by deptno;
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