how to check the 3rd max salary from an employee table?

Answer Posted / rutujagabhane

SELECT *
FROM(
SELECT SALARY, DEPARTMENT_ID,EMPLOYEE_ID, DENSE_RANK() OVER (PARTITION BY DEPARTMENT_ID ORDER BY SALARY DESC) AS RN
FROM EMPLOYEES
)
WHERE RN = 2
;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I join the same table twice?

637


Why do we create views in sql?

659


how to select unique records from a table? : Sql dba

712


What is record type in pl sql?

646


What is clustered and nonclustered index in sql?

588






What is a database event trigger?

690


What is primary key sql?

627


Does pdo prevent sql injection?

608


Which is faster joins or subqueries?

636


What is the need of a partition key?

625


How to avoid using cursors? What to use instead of cursor and in what cases to do so?

737


What is the difference between syntax error and runtime error?

694


What is sql in java?

635


Is left join inner or outer?

684


Is vs as in pl sql?

578