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 is a trigger in mysql? Define different types of trigger. : Sql dba
What is latest version of sql?
What is tuple in sql?
What is a trigger word?
Which is faster truncate or drop?
How do you use join?
What is mutating trigger?
How do we accept inputs from user during runtime?
How are sql commands classified?
What is a call statement? Explain with an example.
explain about mysql and its features. : Sql dba
what is a table in a database ? : Sql dba
Are left and right joins the same?
How many clustered indexes can you have?
Explain the purpose of %type and %rowtype data types?