how to find the second highest salary from emp table?

Answer Posted / bharat g

select * from (select ename,sal,dense_rank() over (order by sal desc) ranking from emp) where ranking=2;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is exit statement?

551


How to sort the rows in sql.

605


What are %type and %rowtype for?

621


Explain how to use transactions efficiently : transact sql

529


What is the order of sql select?

578






How to select random rows from a table?

529


what is a primary key? : Sql dba

558


Is join same as left join?

535


What is the location of pre_defined_functions.

646


How do I delete a trigger?

547


Why stored procedure is faster than query?

521


what is a unique key ? : Sql dba

547


Why is there a need for sqlcode and sqlerrm variables?

589


What is schema in sql example?

603


Explain table and field in sql?

588