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 / basavaraj yadwad

Let Table name : Employee
Let the columns: Employee_name, Salary

To find 101st row:

select * from (select * from Employee order by
emplayee_name) where rownum = 101

To find 4th highest salary

select * from (select * from Employee order by salary desc)
where rownum = 4


To find 5th highest salary

select * from (select * from Employee order by salary desc)
where rownum = 4


To find 1 to 10 highest salary

select * from (select * from Employee order by salary desc)
where rownum < 11

Is This Answer Correct ?    9 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why select is used in sql?

514


Why do we use procedures in sql?

544


what is a database transaction? : Sql dba

581


Why use stored procedures?

566


What are different types of sql commands?

504






What is the least restrictive isolation level? : Transact sql

561


what are the performance and scalability characteristics of mysql? : Sql dba

524


How many sql statements are used?

563


What is dynamic query?

537


What is trigger in flip flop?

512


Is it possible to remove child records without removing master table records...the two having pk,fk relationship?

804


Which is better join or subquery?

602


Is it possible to sort a column using a column alias?

599


Are there any features that are decommissioned in 11g that are not present in 11g?

1587


What is autocommit sql?

535