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
What steps server process has to take to execute an update statement?
Can we join 3 tables in sql?
What is spool?
How do I save the results of sql query in a file?
How many clustered indexes can be created on a table?
What does closing a cursor do?
what is self join and what is the requirement of self join? : Sql dba
List the various privileges that a user can grant to another user?
how to see the create table statement of an existing table? : Sql dba
Which sorts rows in sql?
How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?
What is the difference between inner join and outer join?
Name some usages of database trigger?
What is a unique key and primary key and foreign key?
What are different categories of sql commands?