Query for second maximum salary in each in each department

Answer Posted / suneelkumar

select * from emp x where 2=(select count(distinct sal) from
emp y where x.sal<=y.sal) group by deptno;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does pl/sql support create command?

576


where are cookies actually stored on the hard disk? : Sql dba

578


Explain commit, rollback and savepoint.

605


What is the starting oracle error number?

562


How to place comments in pl/sql?

602






What do you mean by dbms? What are its different types?

554


What is the trigger in sql?

536


What is dynamic query?

539


What is AUTH_ID and AUTH_USER in pl/sql ?

1690


how to rename an existing column in a table? : Sql dba

509


What are database links used for?

591


Explain the types of joins in sql?

571


Which is better join or inner query?

514


How to set up sql*plus output format in oracle?

593


Explain some predefined exceptions.

584