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 / meher

Let the table name is EMP

To find 101st row the query is as below:

select * from EMP where rownum <= 101
minus
select * from EMP where rownum <= 100;


for Nth salary the query is as below:

SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT
(DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How long will it take to learn pl sql?

526


Is sql considered coding?

571


What is record in pl sql?

596


Does pdo prevent sql injection?

521


What is latest version of sql?

528






what are the 'mysql' command line options? : Sql dba

560


what is clause? : Sql dba

594


What is assignment operator in pl sql?

571


What is procedure and function?

520


Can I create table without primary key?

531


Why we use join in sql?

533


What are types of exception?

540


What do you understand by exception handling in pl/sql?

579


What are the advantages of sql? Explain

651


What is the difference between partitioning and sharding?

530