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

What are all the ddl commands?

632


How does pl sql work?

528


What is the sql*loader? : aql loader

591


What are the steps for performance tuning.

847


Which normal form is best?

517






How can we avoid duplicating records in a query?

568


Can we use commit inside a trigger?

529


When can we use the where clause and the having clause?

582


Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

1728


what is auto increment? : Sql dba

576


What is the difference between sum and count in sql?

528


what are the drivers in mysql? : Sql dba

557


Why left join is used in sql?

522


What is difference between inner join and self join?

595


explain the options of myisamchk to improve the performance of a table. : Sql dba

549