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

Which type of cursor is used to execute the dml statement?

534


What are the limitations of sql express?

530


Explain ddl statements in pl/sql?

579


Can dml statements be used in pl/sql?

581


What does cursor do in sql?

520






what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba

674


Which one is faster ienumerable or iqueryable?

488


What is offset in sql query?

598


What is rownum?

543


What is the requirement of self-join?

546


Why are indexes and views important to an organization?

529


how many sql ddl commands are supported by 'mysql'? : Sql dba

531


What are the types of variables use in pl sql?

514


What is t-sql? : Transact sql

543


What is the difference between truncate and drop statements?

581