0

I used below query to find maximum salary for each department.

Select e.deptno,max(e.sal) from emp e inner join dept d
on e.deptno=d.deptno 
group by e.deptno

But i want to display the employee name also whose getting maximum salary in each department.i tried below query but this query is not working properly

Select e.deptno,e.ename,max(e.sal) from emp e inner join dept d
on e.deptno=d.deptno 
group by e.deptno,e.ename
Ram
  • 603
  • 11
  • 30
  • Does this answer your question? [Get top 1 row of each group](https://stackoverflow.com/questions/6841605/get-top-1-row-of-each-group) – Charlieface Sep 30 '21 at 17:16

0 Answers0