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
Which type of cursor is used to execute the dml statement?
What are the limitations of sql express?
Explain ddl statements in pl/sql?
Can dml statements be used in pl/sql?
What does cursor do in sql?
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
Which one is faster ienumerable or iqueryable?
What is offset in sql query?
What is rownum?
What is the requirement of self-join?
Why are indexes and views important to an organization?
how many sql ddl commands are supported by 'mysql'? : Sql dba
What are the types of variables use in pl sql?
What is t-sql? : Transact sql
What is the difference between truncate and drop statements?