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
Describe types of sql statements?
How can we solve sql error: ora-00904: invalid identifier?
what are the advantages a stored procedure? : Sql dba
What are data types in pl sql?
What is sqlcommand?
How do I view a view in sql?
Why is there a need for sqlcode and sqlerrm variables?
what is a database lock ? : Sql dba
How many tables can a sql database have?
What is the sql*loader? : aql loader
Explain the structure of pl/sql in brief.
What is bind variable in pl sql?
What is nvarchar in sql?
What are the limitations of sql express?
Differentiate between % rowtype and type record.