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 / priya
Here It is asked for 101 row. It does not mean ascending or
descending order.
So query goes like this
Ans:select * from emp where rowid in(
select max(no) from
(select rowid as no,sal from emp where rownum<102));
To Find the 101th row higest salary
Ans:
select max(sal) from (
select * from emp order by sal) s where rownum<102;
similarly for 4th highest it is 5 and for (n-1)th sal it is
n.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are sql functions? Describe in brief different types of sql functions?
How do you modify a table in sql?
Is sqlexception checked or unchecked?
Why do we use joins in sql?
how to create a test table in your mysql server? : Sql dba
What are sql queries used for?
Why do we use sqlite?
What are the benefits of triggers?
What is trigger explain it?
How do you rename a table in sql?
What is the least restrictive isolation level? : Transact sql
how to drop an existing view in mysql? : Sql dba
What is the starting oracle error number? What is meant by forward declaration in functions?
What is pl sql block structure?
What are the different dml commands in sql?