how to find the fifth highest salary?

Answer Posted / chandra shekhar

Assuming that EMP table with Sal column

SELECT MIN(sal) FROM
(SELECT DISTINCT sal FROM emp WHERE
ROWNUM < 6
ORDER BY sal DESC )

- If fifth highest then ROWNUM < 6
- If n'th highest then ROWNUM < n+1

Regards
J

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you communicate with an RDBMS?

502


What are the different phases of transaction?

479


What is Domain-Key Normal Form?

467


What is app tier?

468


What is model database? : sql server architect

454






What is difference between 2 tier and 3 tier architecture?

433


Explain what are the restrictions that views have to follow? : sql server architect

462


Name the sub-systems of a RDBMS?

469


What is a Relation Schema and a Relation?

493


What is Data Independence?

529


State the different extensions for stored procedures?

466


What are the levels of architecture?

441


What is an Entity set?

542


How does Tuple-oriented relational calculus differ from domain-oriented relational calculus

459


What are the unary operations in Relational Algebra?

484