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
How do I decide when to use right joins/left joins or inner joins or how to determine which table is on which side?
What is the recommended interval at which to run statspack snapshots, and why?
What is the quickest way to fetch the data from a table?
How to select an oracle system id (sid)?
Which is better Oracle or MS SQL? Why?
How to turn on or off recycle bin for the instance?
How to find out what oracle odbc drivers are installed?
What is the simplest tool to run commands on oracle servers?
What are the major difference between truncate and delete?
What are the limitations of check constraint?
Can we use bind variables in oracle stored procedure?
What is dual table oracle?
What is the difference between pre-select and pre-query?
Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.
How do I use unicode codesets with the weblogic jdriver for oracle driver?