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


Please Help Members By Posting Answers For Below Questions

Can delete statement be rollbacked?

1065


define sql insert statement ? : Sql dba

1108


Can we rollback truncate?

1083


How do I remove duplicates in two columns?

1202


what is dbms? : Sql dba

1070


how to escape special characters in sql statements? : Sql dba

1124


what is schema? : Sql dba

1163


what are the advantages of sql ? : Sql dba

1154


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

1252


what is collation? : Sql dba

1242


how to use regular expression in pattern match conditions? : Sql dba

1125


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

1155


Does group by remove duplicates?

1120


Do we need to rebuild index after truncate?

1151


what is sql server agent? : Sql dba

1188