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