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
Can a varchar be a primary key?
Can you call pl/sql package functions from within a fast formula?
Is oracel sql developer written in java?
What problem one might face while writing log information to a data-base table in pl/sql?
What is localdb mssqllocaldb?
How many types of index are there?
Does execute immediate commit?
Why do we use procedures in sql?
Which is faster joins or subqueries?
Are subqueries faster than joins?
What is package in pl sql with an examples?
Why do we use sql constraints?
What is the use of function in sql?
How can you know that statistics should be updated?
What is pl sql collection?