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

When do we use triggers?

587


What's the difference between a primary key and a clustered index?

519


What is sql and how does it work?

551


How do I audit the sql sent to the server?

526


differentiate between float and double. : Sql dba

563






What is a left join?

514


What is varchar data type in sql?

520


What are the most important characteristics of pl/sql?

580


What does select * from mean in sql?

2002


What is db journal file?

522


what is difference between delete and truncate commands? : Sql dba

581


Difference between truncate, delete and drop commands?

559


Can I learn sql in a week?

554


What are the different sql languages?

544


How delete all data from all tables in sql?

540