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

How do you optimize a stored procedure query?

740


What is pl sql commands?

732


What is bulk collect in pl sql?

729


Is it possible for a table to have more than one foreign key?

776


What are the different types of constraints?

742






What is difference between table and view?

708


how can we know the number of days between two given dates using mysql? : Sql dba

748


Why do we use sql constraints? Which constraints we can use while creating database in sql?

728


How does index help in query performance?

765


Name the different types of indexes in sql and define them.

788


what is a database? : Sql dba

809


Explain about various levels of constraint.

702


What is procedure function?

712


What is rowid in sql?

678


What is the difference between join and natural join?

655