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
What is prepared statement in sql?
How many types of cursors are available in pl/sql?
How do I remove sql plus from windows 10?
What is a table in a database?
What is a common use of group by in sql?
what is the difference between cluster and non cluster index? : Sql dba
What is rank function in sql?
how is myisam table stored? : Sql dba
What are predefined functions in sql?
what is csv? : Sql dba
Which column of the user triggers data dictionary view displays the database event that will fire the trigger?
What is difference between sql and mysql?
What is primary key sql?
what is auto increment? : Sql dba
What is sqlerrm?