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
What are all the ddl commands?
How does pl sql work?
What is the sql*loader? : aql loader
What are the steps for performance tuning.
Which normal form is best?
How can we avoid duplicating records in a query?
Can we use commit inside a trigger?
When can we use the where clause and the having clause?
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
what is auto increment? : Sql dba
What is the difference between sum and count in sql?
what are the drivers in mysql? : Sql dba
Why left join is used in sql?
What is difference between inner join and self join?
explain the options of myisamchk to improve the performance of a table. : Sql dba