display records from 5 to 9 using rowid or rownum
Answers were Sorted based on User's Feedback
Answer / vinay shankar
select * from emp
where rownum <=9
minus
select * from emp
where rownum <5
Is This Answer Correct ? | 31 Yes | 6 No |
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 |
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 |
Answer / hari
select * from (select rownum rm,id from emp where rownum<=9) where rn >=5)
Is This Answer Correct ? | 4 Yes | 5 No |
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 |
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...
Which is better join or inner query?
How do you declare a user-defined exception?
What is record variable?
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?
Is crud a cuss word?
What is sql dialect?
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
What does <> sql mean?
Is sql a programming?
Explain Connect by Prior?
how to create a test table in your mysql server? : Sql dba