suppose we have a table in which 200 rows. i want to find
101 row ? what the query....
and how we find 4th and 5th highest salary and 1 to 10
highest salary

Answer Posted / m.raghu

answer for 101th record

select * from emp where empno in( select decode
(rownum,&n,empno) from emp);

for 4th highest sal

select distinct sal from(select empno,dense_rank() over
(order by sal desc) rnk from emp) where rnk=&n;

for 5th highest sal give n value=5
for 1-10

select distinct sal from(select empno,dense_rank() over
(order by sal desc) rnk from emp) where rnk<=&n;

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a varchar be a primary key?

697


Can you call pl/sql package functions from within a fast formula?

769


Is oracel sql developer written in java?

837


What problem one might face while writing log information to a data-base table in pl/sql?

761


What is localdb mssqllocaldb?

803






How many types of index are there?

724


Does execute immediate commit?

927


Why do we use procedures in sql?

768


Which is faster joins or subqueries?

715


Are subqueries faster than joins?

726


What is package in pl sql with an examples?

729


Why do we use sql constraints?

854


What is the use of function in sql?

728


How can you know that statistics should be updated?

799


What is pl sql collection?

694