Query for second maximum salary in each in each department

Answer Posted / sureshramsing

select * from(select row_number() over(partition by deptno order by sal desc) rn,a.* from emp a) where rn=1;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I view output in sql developer?

576


What is the difference between nvl function, ifnull function, and isnull function?

587


what is a primary key? : Sql dba

552


What is the advantage of nosql?

525


How can I make sql query run faster?

558






Mention what does plv msg allows you to do?

663


How would you pass hints to the sql processor?

528


What is the difference between sql and mysql?

556


What is the difference between functions, procedures, and packages in pl/sql?

482


What is the use of index in hive?

548


How do we use distinct statement? What is its use?

551


What is the function that is used to transfer a pl/sql table log to a database table?

553


What is rownum in sql?

557


Is sql the best database?

499


Can we write dml inside a function in sql server?

499