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 ADDM Advisor in Oracle?

665


In oracle there is column command, how will you explain that?

554


What is the string concatenation operator in oracle?

570


What is coalesce function?

575


In which language oracle has been developed?

649






How to update values in a table in oracle?

579


What is a subquery?

614


How would you go about verifying the network name that the local_listener is currently using?

1609


Which is better Oracle or MS SQL? Why?

5440


How to store only time; not date and time?

557


How to convert csv to table in oracle?

528


What to do if the binary spfile is wrong for the default instance?

564


What are the differences between lov and list item?

559


How do you tell what your machine name is and what is its IP address?

1516


Is there an oracle sql query that aggregates multiple rows into one row?

546