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 / 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
Can delete statement be rollbacked?
define sql insert statement ? : Sql dba
Can we rollback truncate?
How do I remove duplicates in two columns?
what is dbms? : Sql dba
how to escape special characters in sql statements? : Sql dba
what is schema? : Sql dba
what are the advantages of sql ? : Sql dba
If a cursor is open, how can we find in a pl/sql block?
what is collation? : Sql dba
how to use regular expression in pattern match conditions? : Sql dba
how many tables will create when we create table, what are they? : Sql dba
Does group by remove duplicates?
Do we need to rebuild index after truncate?
what is sql server agent? : Sql dba