adspace


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

Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

2100


what is collation? : Sql dba

1242


what are all the common sql function? : Sql dba

1141


How do I remove duplicates in two columns?

1202


What is the current version of postgresql?

1188


what is schema? : Sql dba

1163


What is your daily office routine?

2352


define sql insert statement ? : Sql dba

1108


If a cursor is open, how can we find in a pl/sql block?

1252


Do we need to rebuild index after truncate?

1151


how many tables will create when we create table, what are they? : Sql dba

1155


Is inner join faster than left join?

1287


Can we use distinct and group by together?

1146


what is sql server agent? : Sql dba

1188


What is the current version of sql?

1106