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

Describe the three levels of data abstraction?

528


What are the different phases of transaction?

487


What is an Entity type?

508


What is DDL (Data Definition Language)?

527


What are the the Advantages of DBMS?

494






State about the security aspects of stored procedures?

559


What is a business logic layer?

448


What are the levels of architecture?

449


What is 4NF?

516


What are external procedures ? Why and when they are used?

480


What are the primitive operations common to all record management systems?

564


What is the difference between cube operator and roll up operator? : sql server architect

483


What is durability in DBMS?

563


What is an Entity?

499


What is database architecture? : sql server architect

477