I have one table :EID,Depid,ename,sal
I want to have max(sal) in each department.

Answer Posted / narasimha


select e.eid,e.sal,e.depid,e.ename,e.sal from emp e
where 1>(select count(*) from emp w where e.sal<w.sal and
e.depid=w.depid) order by e.deptno asc

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the Tune Query

1924


How can I see all tables in oracle?

629


Explain the use of rows option in exp command.

655


Explain the use of grant option in exp command.

667


How to get maxsal , minsal, ename department wise in single query

1133






Describe varray?

685


What is the minimum client footprint required to connect c# to an oracle database?

641


How to define a variable of a specific record type?

694


Why should I use oracle database?

650


Why cursor variables are easier to use than cursors?

656


Can we commit inside a function in oracle?

646


Explain the features of oracle?

682


Difference between the “verify” and “feedback” command?

888


Explain a synonym?

683


How to get execution path reports on query statements?

646