how to find the fifth highest salary?

Answer Posted / saraswathi muthuraman

SQL> select * from emp_test order by sal desc;

1003 20010 11
1001 10000 11
1001 10000 11
1002 100 11
1004 99 11
1005 50 11
1006 25 11

SQL> select * from (select emp_no,dep_no,sal,rank() over
(order by sal desc) as rank_list from emp_test) where
rank_list =5;

1004 11 99 5

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about the implementation of business logic in stored procedures?

416


What do you mean by atomicity and aggregation?

506


what is the difference between LENGTH AND SIZE?

2132


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

462


What is a view? How it is related to data independence?

475






Explain what are the database objects? : sql server architect

455


can we use transformer in datastage without any input link?

1326


What is database architecture? : sql server architect

474


What is Relationship type?

526


What is E-R model?

516


What is a Relation Schema and a Relation?

493


What is Functional Dependency?

454


What is DML Compiler?

570


Describe the three levels of data abstraction?

520


What is the difference between "is" and "as" while creating procedure?

430