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 is a sql*loader control file?
Can you join views in sql?
what is a composite key ? : Sql dba
Can we create table inside stored procedure?
What is pl sql collection?
Which command is used to call a stored procedure?
when MSQL8.0 is in market
Why we use cross join?
What is cte?
What is the most restrictive isolation level? : Transact sql
How to test for null values?
Where is pl sql used?
What are actual parameters and formal parameters?
Can we use distinct and group by together?
What does the base_object_type column shows in the user.triggers data dictionary view?