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

What are the three levels of database architecture?

425


What is the difference between a user defined function and a stored procedure?

500


What are the three tiers in a 3 tier architecture?

442


What is 2 tier 3 tier architecture?

497


What is temp db database? : sql server architect

491






What is Data Independence?

541


What is Multivalued dependency?

475


What is Relationship set?

473


Define the "integrity rules"?

485


What is n tier architecture with example?

432


What is single tier architecture?

450


What is DML (Data Manipulation Language)?

523


What is an Entity type?

510


What is the difference between layer and tier?

483


What is an Entity set?

551