display records from 5 to 9 using rowid or rownum

Answers were Sorted based on User's Feedback



display records from 5 to 9 using rowid or rownum..

Answer / vinay shankar

select * from emp
where rownum <=9
minus
select * from emp
where rownum <5

Is This Answer Correct ?    31 Yes 6 No

display records from 5 to 9 using rowid or rownum..

Answer / chiru

select * from (select rownum r ,a.* from emp a ) where r between 5 and 9

Is This Answer Correct ?    7 Yes 0 No

display records from 5 to 9 using rowid or rownum..

Answer / ramaraju

select
ename
from
emp
order by ename
offset 4 rows
fetch next 5 rows only;

try this answer oracle 12c introduced offset fetch rows.

Is This Answer Correct ?    1 Yes 0 No

display records from 5 to 9 using rowid or rownum..

Answer / hari

select * from (select rownum rm,id from emp where rownum<=9) where rn >=5)

Is This Answer Correct ?    4 Yes 5 No

display records from 5 to 9 using rowid or rownum..

Answer / satya

select empno,ename,sal from emp
group by rownum,empno,ename,sal
having rownum between 5 and 9;

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More SQL PLSQL Interview Questions

I am creating an index on Emp table Empno column,if u using this indexed column in ur SELECT stmt. where clause,then how do u know that yr index will be working or nor? Thanks Advance...

3 Answers  


Which is better join or inner query?

0 Answers  


How do you declare a user-defined exception?

0 Answers  


What is record variable?

0 Answers  


what is the differnce between procedure and function? in both dml operations can work and in procedure through out parameter you can return value ,then what is the differce?

3 Answers   3i Infotech,






Is crud a cuss word?

0 Answers  


What is sql dialect?

0 Answers  


I have one table and column is c1 pk, c2 not null,c3 not null and 200 row in it and i add c4 column and value, how can is possible

9 Answers  


What does <> sql mean?

0 Answers  


Is sql a programming?

0 Answers  


Explain Connect by Prior?

2 Answers  


how to create a test table in your mysql server? : Sql dba

0 Answers  


Categories