Write a query to find second highest salary of an employee.

Answer Posted / oboyah

SELECT e1.* from ( SELECT last_name, salary,
DENSE_RANK() OVER ( ORDER BY salary DESC) rank
FROM employees) e1 where e1.Rank = 2;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of design view?

527


What operators deal with null?

607


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

558


What is the order of sql select?

572


How can we optimize a sql query?

577






What are the differences between implicit and explicit cursors?

521


what are different types of keys in sql?

608


What is scope and visibility in PL/SQL?

600


How do you take the union of two tables in sql?

517


Are stored procedures compiled?

525


What is the difference between a primary key and a clustered index?

526


What is the sql*loader? : aql loader

589


What does the argument [or replace] do?

581


When do we use triggers?

585


what are different types of collation sensitivity? : Sql dba

557